diff options
author | Zuul <zuul@review.openstack.org> | 2018-10-15 17:36:29 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2018-10-15 17:36:29 +0000 |
commit | 5e8af9fc090b97c43ac1df20547b65a8e85ed4f2 (patch) | |
tree | 8fb8311589e45c85d094e30a1c7c1abf5505218d /nova/objects | |
parent | 396156eb13521a0e7af4488a8cd4693aa65a0da2 (diff) | |
parent | b49209cc29f5ccd529b8074b68be074c5a2f742f (diff) | |
download | nova-5e8af9fc090b97c43ac1df20547b65a8e85ed4f2.tar.gz |
Merge "Use nova-consoleauth only if workaround enabled"
Diffstat (limited to 'nova/objects')
-rw-r--r-- | nova/objects/console_auth_token.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/nova/objects/console_auth_token.py b/nova/objects/console_auth_token.py index d5d01ab039..e6e5a2e58c 100644 --- a/nova/objects/console_auth_token.py +++ b/nova/objects/console_auth_token.py @@ -74,6 +74,24 @@ class ConsoleAuthToken(base.NovaTimestampObject, base.NovaObject): obj.obj_reset_changes() return obj + def to_dict(self): + """Convert to a dict representation.""" + # NOTE(PaulMurray) For compatibility while there is code that + # expects the dict representation returned by consoleauth. + # TODO(PaulMurray) Remove this function when the code no + # longer expects the consoleauth dict representation + connect_info = {} + connect_info['token'] = self.token, + connect_info['instance_uuid'] = self.instance_uuid + connect_info['console_type'] = self.console_type + connect_info['host'] = self.host + connect_info['port'] = self.port + if 'internal_access_path' in self: + connect_info['internal_access_path'] = self.internal_access_path + if 'access_url_base' in self: + connect_info['access_url'] = self.access_url + return connect_info + @base.remotable def authorize(self, ttl): """Authorise the console token and store in the database. |