Skip to content

Commit

Permalink
Merge pull request #29773 from dillaman/wip-41352
Browse files Browse the repository at this point in the history
pybind/mgr/rbd_support: fix missing variable in error path

Reviewed-by: Mykola Golub <mgolub@suse.com>
  • Loading branch information
trociny committed Aug 21, 2019
2 parents 88662a4 + e574187 commit e867804
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pybind/mgr/rbd_support/module.py
Expand Up @@ -1082,7 +1082,7 @@ def get_migration_status(self, ioctx, image_spec):
except (rbd.InvalidArgument, rbd.ImageNotFound):
return None

def validate_image_migrating(self, migration_status):
def validate_image_migrating(self, image_spec, migration_status):
if not migration_status:
raise rbd.InvalidArgument("Image {} is not migrating".format(
self.format_image_spec(image_spec)), errno=errno.EINVAL)
Expand Down Expand Up @@ -1112,7 +1112,7 @@ def queue_migration_execute(self, image_spec):
if task:
return 0, task.to_json(), ''

self.validate_image_migrating(status)
self.validate_image_migrating(image_spec, status)
if status['state'] not in [rbd.RBD_IMAGE_MIGRATION_STATE_PREPARED,
rbd.RBD_IMAGE_MIGRATION_STATE_EXECUTING]:
raise rbd.InvalidArgument("Image {} is not in ready state".format(
Expand Down Expand Up @@ -1148,7 +1148,7 @@ def queue_migration_commit(self, image_spec):
if task:
return 0, task.to_json(), ''

self.validate_image_migrating(status)
self.validate_image_migrating(image_spec, status)
if status['state'] != rbd.RBD_IMAGE_MIGRATION_STATE_EXECUTED:
raise rbd.InvalidArgument("Image {} has not completed migration".format(
self.format_image_spec(image_spec)), errno=errno.EINVAL)
Expand Down Expand Up @@ -1176,7 +1176,7 @@ def queue_migration_abort(self, image_spec):
if task:
return 0, task.to_json(), ''

self.validate_image_migrating(status)
self.validate_image_migrating(image_spec, status)
return 0, self.add_task(ioctx,
"Aborting image migration for {}".format(
self.format_image_spec(image_spec)),
Expand Down

0 comments on commit e867804

Please sign in to comment.