summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorMichael Gundlach <michael.gundlach@rackspace.com>2010-10-12 18:27:59 -0400
committerMichael Gundlach <michael.gundlach@rackspace.com>2010-10-12 18:27:59 -0400
commitaa92c017ab91d7fb0ec9c2cd5fd420e625ce2dbd (patch)
treecb912bfa62fbd9023d87a8e41657a746e13d4e61 /nova
parentf97ef73699e060a21ef8e64966f2429ff3dec237 (diff)
downloadnova-aa92c017ab91d7fb0ec9c2cd5fd420e625ce2dbd.tar.gz
nova-aa92c017ab91d7fb0ec9c2cd5fd420e625ce2dbd.tar.xz
nova-aa92c017ab91d7fb0ec9c2cd5fd420e625ce2dbd.zip
Revert 64 bit storage and use 32 bit again. I didn't notice that we verify that randomly created uids don't already exist in the DB, so the chance of collision isn't really an issue until we get to tens of thousands of machines. Even then we should only expect a few retries before finding a free ID.
Diffstat (limited to 'nova')
-rw-r--r--nova/db/sqlalchemy/models.py4
-rw-r--r--nova/utils.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/nova/db/sqlalchemy/models.py b/nova/db/sqlalchemy/models.py
index 9809eb7a7..fc99a535d 100644
--- a/nova/db/sqlalchemy/models.py
+++ b/nova/db/sqlalchemy/models.py
@@ -25,7 +25,7 @@ import datetime
# TODO(vish): clean up these imports
from sqlalchemy.orm import relationship, backref, exc, object_mapper
-from sqlalchemy import Column, PickleType, Integer, String
+from sqlalchemy import Column, Integer, String
from sqlalchemy import ForeignKey, DateTime, Boolean, Text
from sqlalchemy.exc import IntegrityError
from sqlalchemy.ext.declarative import declarative_base
@@ -152,7 +152,7 @@ class Instance(BASE, NovaBase):
__tablename__ = 'instances'
__prefix__ = 'i'
id = Column(Integer, primary_key=True)
- internal_id = Column(PickleType(mutable=False), unique=True)
+ internal_id = Column(Integer, unique=True)
admin_pass = Column(String(255))
diff --git a/nova/utils.py b/nova/utils.py
index 12afd388f..10b27ffec 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -128,7 +128,7 @@ def runthis(prompt, cmd, check_exit_code = True):
def generate_uid(topic, size=8):
if topic == "i":
# Instances have integer internal ids.
- return random.randint(0, 2**64-1)
+ return random.randint(0, 2**32-1)
else:
characters = '01234567890abcdefghijklmnopqrstuvwxyz'
choices = [random.choice(characters) for x in xrange(size)]