diff options
author | Zuul <zuul@review.opendev.org> | 2020-09-24 10:43:09 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2020-09-24 10:43:09 +0000 |
commit | d8f98d8203e60ae131314642f3ae25fe819ee661 (patch) | |
tree | dc3e25c0b2d86ed171e19302a825271b8bbb23ac | |
parent | fb13427c7811cddb3a2a692eb92d0c49694f0bb5 (diff) | |
parent | a4a549a1814a9ea9f142fd8ec5928fe9cfebc269 (diff) | |
download | horizon-d8f98d8203e60ae131314642f3ae25fe819ee661.tar.gz |
Merge "Fix: Page crashes on instance confirm resize"
-rw-r--r-- | openstack_dashboard/dashboards/project/instances/tables.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/openstack_dashboard/dashboards/project/instances/tables.py b/openstack_dashboard/dashboards/project/instances/tables.py index c839f1531..56af9b8f3 100644 --- a/openstack_dashboard/dashboards/project/instances/tables.py +++ b/openstack_dashboard/dashboards/project/instances/tables.py @@ -624,8 +624,14 @@ class ConfirmResize(policy.PolicyTargetMixin, tables.Action): def allowed(self, request, instance): return instance.status == 'VERIFY_RESIZE' - def single(self, table, request, instance): - api.nova.server_confirm_resize(request, instance) + def single(self, table, request, obj_id): + instance = table.get_object_by_id(obj_id) + try: + api.nova.server_confirm_resize(request, instance.id) + except Exception: + exceptions.handle(request, + _('Unable to confirm resize instance "%s".') + % (instance.name or instance.id)) return shortcuts.redirect(request.get_full_path()) @@ -638,8 +644,14 @@ class RevertResize(policy.PolicyTargetMixin, tables.Action): def allowed(self, request, instance): return instance.status == 'VERIFY_RESIZE' - def single(self, table, request, instance): - api.nova.server_revert_resize(request, instance) + def single(self, table, request, obj_id): + instance = table.get_object_by_id(obj_id) + try: + api.nova.server_revert_resize(request, instance.id) + except Exception: + exceptions.handle(request, + _('Unable to revert resize instance "%s".') + % (instance.name or instance.id)) class RebuildInstance(policy.PolicyTargetMixin, tables.LinkAction): |