summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorPhilip Knouff <philip.knouff@mailtrust.com>2012-02-08 17:32:13 -0500
committerPhilip Knouff <philip.knouff@mailtrust.com>2012-02-09 12:56:04 -0500
commit6a823d0e1670507a6f4674d5f70e8d9ce0b4c3df (patch)
treecafe9d094f9beb85d216afb05b8334fd4e117dae /nova/api
parentb8944efb1e2c87a9136f941eddaf90fc02b7fffb (diff)
Ensures that hostId's are unique
fixes bug #928015 Change-Id: I26e1e036ee56e0ee4344f9254df4c7024e0ceddf
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/views/servers.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/nova/api/openstack/compute/views/servers.py b/nova/api/openstack/compute/views/servers.py
index 6a1622a66..e923c8286 100644
--- a/nova/api/openstack/compute/views/servers.py
+++ b/nova/api/openstack/compute/views/servers.py
@@ -146,8 +146,10 @@ class ViewBuilder(common.ViewBuilder):
@staticmethod
def _get_host_id(instance):
host = instance.get("host")
+ project = str(instance.get("project_id"))
if host:
- return hashlib.sha224(host).hexdigest() # pylint: disable=E1101
+ sha_hash = hashlib.sha224(project + host) # pylint: disable=E1101
+ return sha_hash.hexdigest()
def _get_addresses(self, request, instance):
context = request.environ["nova.context"]