summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Lucio <rlucio@internap.com>2010-12-07 19:07:47 +0000
committerTarmac <>2010-12-07 19:07:47 +0000
commit934014998b0649fbcbd5f8a5f87f88597949da24 (patch)
treec8ddc6c5dc527c07c814597aed3424017048e3f5
parentb3ea4eac33c160f574c36acda451294fc6d2bf87 (diff)
parent4f2a8c5398d4d4848f441e366e8bcc5e97a0b34f (diff)
downloadnova-934014998b0649fbcbd5f8a5f87f88597949da24.tar.gz
nova-934014998b0649fbcbd5f8a5f87f88597949da24.tar.xz
nova-934014998b0649fbcbd5f8a5f87f88597949da24.zip
Addresses bug 677475 by changing the DB column for internal_id in the instances table to be unsigned.
-rw-r--r--nova/db/sqlalchemy/api.py2
-rw-r--r--nova/image/local.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py
index dd9649054..2dc140274 100644
--- a/nova/db/sqlalchemy/api.py
+++ b/nova/db/sqlalchemy/api.py
@@ -543,7 +543,7 @@ def instance_create(context, values):
with session.begin():
while instance_ref.internal_id == None:
# Instances have integer internal ids.
- internal_id = random.randint(0, 2 ** 32 - 1)
+ internal_id = random.randint(0, 2 ** 31 - 1)
if not instance_internal_id_exists(context, internal_id,
session=session):
instance_ref.internal_id = internal_id
diff --git a/nova/image/local.py b/nova/image/local.py
index 9b0cdcc50..b44593221 100644
--- a/nova/image/local.py
+++ b/nova/image/local.py
@@ -59,7 +59,7 @@ class LocalImageService(service.BaseImageService):
"""
Store the image data and return the new image id.
"""
- id = random.randint(0, 2 ** 32 - 1)
+ id = random.randint(0, 2 ** 31 - 1)
data['id'] = id
self.update(context, id, data)
return id