
from pylxd import api
from pylxd import exceptions as lxd_exceptions


def upload_image(image):
    alias = "{}/{}/{}/{}".format(
        image["os"], image["release"], image["arch"], image["variant"]
    )
    lxd = api.API()
    imgs = api.API(host="images.linuxcontainers.org")
    d = imgs.alias_show(alias)

    meta = d[1]["metadata"]
    tgt = meta["target"]

    try:
        lxd.alias_update(meta)
    except lxd_exceptions.APIError as ex:
        if ex.status_code == 404:
            lxd.alias_create(meta)

    return tgt


def delete_image(image):
    lxd = api.API()
    lxd.image_delete(image)


from pylxd import api


def delete_image(image):
    lxd = api.API()
    lxd.image_delete(image)

Remove unused testing utility function
Remove unused testing utility function

Signed-off-by: Dougal Matthews <8f24f2c0fd825cfb6716a36822888c4a01678c88@dougalmatthews.com>

  
  from pylxd import api
- from pylxd import exceptions as lxd_exceptions
- 
- 
- def upload_image(image):
-     alias = "{}/{}/{}/{}".format(
-         image["os"], image["release"], image["arch"], image["variant"]
-     )
-     lxd = api.API()
-     imgs = api.API(host="images.linuxcontainers.org")
-     d = imgs.alias_show(alias)
- 
-     meta = d[1]["metadata"]
-     tgt = meta["target"]
- 
-     try:
-         lxd.alias_update(meta)
-     except lxd_exceptions.APIError as ex:
-         if ex.status_code == 404:
-             lxd.alias_create(meta)
- 
-     return tgt
  
  
  def delete_image(image):
      lxd = api.API()
      lxd.image_delete(image)
  
Remove unused testing utility function
## Code Before:

from pylxd import api
from pylxd import exceptions as lxd_exceptions


def upload_image(image):
    alias = "{}/{}/{}/{}".format(
        image["os"], image["release"], image["arch"], image["variant"]
    )
    lxd = api.API()
    imgs = api.API(host="images.linuxcontainers.org")
    d = imgs.alias_show(alias)

    meta = d[1]["metadata"]
    tgt = meta["target"]

    try:
        lxd.alias_update(meta)
    except lxd_exceptions.APIError as ex:
        if ex.status_code == 404:
            lxd.alias_create(meta)

    return tgt


def delete_image(image):
    lxd = api.API()
    lxd.image_delete(image)

## Instruction:
Remove unused testing utility function
## Code After:

from pylxd import api


def delete_image(image):
    lxd = api.API()
    lxd.image_delete(image)
