summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorCerberus <matt.dietz@rackspace.com>2011-03-02 11:39:30 -0600
committerCerberus <matt.dietz@rackspace.com>2011-03-02 11:39:30 -0600
commit8707a7a28c75e789f327b20f4cec779a6e8712d2 (patch)
tree6c3f8541b3dcfc715c2f73cda9aff0401d919d0b /nova/api
parent8a9130eae5a421c52573a0fb34fb0125e594ef83 (diff)
parentbb7c1b8c63632c789ed0cd3785a22b7baa90fd83 (diff)
Merge from trunk
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/servers.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index d5c79a1c0..0c3176a11 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)