diff options
| author | Brian Lamar <brian.lamar@rackspace.com> | 2011-03-01 15:58:36 -0500 |
|---|---|---|
| committer | Brian Lamar <brian.lamar@rackspace.com> | 2011-03-01 15:58:36 -0500 |
| commit | 7c18a45d8c4762f59dd4bb01bf01c80798b414e1 (patch) | |
| tree | d9b4ee1fd866369a119a9ac14c797511d72208b8 /nova/api | |
| parent | 05a96b320cf1d6b911b0edb11df0ed408a894e77 (diff) | |
| parent | bb7c1b8c63632c789ed0cd3785a22b7baa90fd83 (diff) | |
| download | nova-7c18a45d8c4762f59dd4bb01bf01c80798b414e1.tar.gz nova-7c18a45d8c4762f59dd4bb01bf01c80798b414e1.tar.xz nova-7c18a45d8c4762f59dd4bb01bf01c80798b414e1.zip | |
Merged trunk
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/servers.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index f7ad0b8ae..69273ad7b 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +import hashlib import json import traceback @@ -71,14 +72,16 @@ def _translate_detail_keys(inst): public_ips = utils.get_from_path(inst, 'fixed_ip/floating_ips/address') inst_dict['addresses']['public'] = public_ips - inst_dict['hostId'] = '' - # Return the metadata as a dictionary metadata = {} for item in inst['metadata']: metadata[item['key']] = item['value'] inst_dict['metadata'] = metadata + inst_dict['hostId'] = '' + if inst['host']: + inst_dict['hostId'] = hashlib.sha224(inst['host']).hexdigest() + return dict(server=inst_dict) |
