diff options
author | Rajesh Tailor <ratailor@redhat.com> | 2022-10-11 18:01:17 +0530 |
---|---|---|
committer | Rajesh Tailor <ratailor@redhat.com> | 2023-01-23 16:36:26 +0530 |
commit | ec40d5aee34e9428e2a19231fc3df4d23d75b779 (patch) | |
tree | bb98340e1e4f1116b4941f41eedd7989ed40c8bd /nova/api/openstack/compute | |
parent | d8b4b7bebdc0f55353cd99f372044b9e30315a6d (diff) | |
download | nova-ec40d5aee34e9428e2a19231fc3df4d23d75b779.tar.gz |
Handle InstanceInvalidState exception
When instance task state is 'deleting' or 'migrating', then
get_vnc_console throws 500 error, as InstanceInvalidState
exception is not handled there.
This change handles InstanceInvalidState in api layer in
get_vnc_console call.
Closes-Bug: #1968618
Change-Id: Ia738a0972b050f549f446c85171d3f33e60ada4f
Diffstat (limited to 'nova/api/openstack/compute')
-rw-r--r-- | nova/api/openstack/compute/remote_consoles.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/api/openstack/compute/remote_consoles.py b/nova/api/openstack/compute/remote_consoles.py index 36015542aa..7d374ef432 100644 --- a/nova/api/openstack/compute/remote_consoles.py +++ b/nova/api/openstack/compute/remote_consoles.py @@ -56,6 +56,9 @@ class RemoteConsolesController(wsgi.Controller): raise webob.exc.HTTPNotFound(explanation=e.format_message()) except exception.InstanceNotReady as e: raise webob.exc.HTTPConflict(explanation=e.format_message()) + except exception.InstanceInvalidState as e: + common.raise_http_conflict_for_instance_invalid_state( + e, 'get_vnc_console', id) except NotImplementedError: common.raise_feature_not_supported() |