From c39c60ddcb3eafe8cae17633e0e3c8103e6ce2b2 Mon Sep 17 00:00:00 2001 From: weikeyou Date: Thu, 23 Aug 2018 14:10:19 +0800 Subject: [PATCH] Remove image 'host' parameter when delete image. Image object has added 'host', just uuid is necessary when delete image. Change-Id: I64a3504ca47df7141a9339ec90a767daf2ba509a --- zunclient/osc/v1/images.py | 5 ----- zunclient/v1/images.py | 4 ++-- zunclient/v1/images_shell.py | 6 +----- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/zunclient/osc/v1/images.py b/zunclient/osc/v1/images.py index 803dd0d8..c2b5e451 100644 --- a/zunclient/osc/v1/images.py +++ b/zunclient/osc/v1/images.py @@ -166,17 +166,12 @@ class DeleteImage(command.Command): 'uuid', metavar='', help='UUID of image to describe') - parser.add_argument( - 'host', - metavar='', - help='Name or UUID of the host') return parser def take_action(self, parsed_args): client = _get_client(self, parsed_args) opts = {} opts['image_id'] = parsed_args.uuid - opts['host'] = parsed_args.host try: client.images.delete(**opts) print(_('Request to delete image %s has been accepted.') diff --git a/zunclient/v1/images.py b/zunclient/v1/images.py index 5323f3fc..a3efd284 100644 --- a/zunclient/v1/images.py +++ b/zunclient/v1/images.py @@ -90,12 +90,12 @@ class ImageManager(base.Manager): "Key must be in %s" % ','.join(PULL_ATTRIBUTES)) return self._create(self._path(), new) - def delete(self, image_id, **kwargs): + def delete(self, image_id): """Delete an image :params image_id: uuid of the image. """ - return self._delete(self._path(image_id), qparams=kwargs) + return self._delete(self._path(image_id)) def search_image(self, image, **kwargs): """Retrieves list of images based on image name and image_driver name diff --git a/zunclient/v1/images_shell.py b/zunclient/v1/images_shell.py index 0a03bae9..459ddca1 100644 --- a/zunclient/v1/images_shell.py +++ b/zunclient/v1/images_shell.py @@ -73,14 +73,10 @@ def do_image_show(cs, args): @utils.arg('id', metavar='', help='UUID of image to delete') -@utils.arg('host', - metavar='', - help='Name or UUID of the host') def do_image_delete(cs, args): - """Delete a specified image from a host.""" + """Delete a specified image.""" opts = {} opts['image_id'] = args.id - opts['host'] = args.host cs.images.delete(**opts)