diff options
| author | Mike Pittaro <mikeyp@LaHondaResearch.org> | 2012-02-03 15:46:01 -0800 |
|---|---|---|
| committer | Mike Pittaro <mikeyp@LaHondaResearch.org> | 2012-02-07 15:52:45 -0800 |
| commit | 229221ec9780112981aedfc8849272aa49a9b25b (patch) | |
| tree | b347339f9b95494a250cce098fbf2cc05e62c3a6 /nova/api | |
| parent | 8f7bc2ee6c14fe6dc16d27353869a7a35f4931f0 (diff) | |
Fix bug 921814 changes handling of adminPass in API.
Add a new nova configuration flag, boolean, enable_instance_password.
When the flag is True (default), existing behavior is unchanged.
When the flag is False, responses from the create or
rebuild API calls don't include the adminPass attribute.
Change-Id: Icb2bd703770f3a39bb1e458dc31e1489d48da7c1
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/servers.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py index 8f9ee01df..57adf22ae 100644 --- a/nova/api/openstack/compute/servers.py +++ b/nova/api/openstack/compute/servers.py @@ -784,7 +784,8 @@ class Controller(wsgi.Controller): if '_is_precooked' in server['server'].keys(): del server['server']['_is_precooked'] else: - server['server']['adminPass'] = password + if FLAGS.enable_instance_password: + server['server']['adminPass'] = password robj = wsgi.ResponseObject(server) @@ -1107,7 +1108,9 @@ class Controller(wsgi.Controller): view = self._view_builder.show(req, instance) # Add on the adminPass attribute since the view doesn't do it - view['server']['adminPass'] = password + # unless instance passwords are disabled + if FLAGS.enable_instance_password: + view['server']['adminPass'] = password robj = wsgi.ResponseObject(view) return self._add_location(robj) |
