diff options
| author | Brian Waldon <brian.waldon@rackspace.com> | 2011-09-23 10:35:18 -0400 |
|---|---|---|
| committer | Brian Waldon <brian.waldon@rackspace.com> | 2011-09-26 09:40:22 -0400 |
| commit | 7a95f73ad7b295ddd2313152973c6da2c78fac76 (patch) | |
| tree | 132b95361214e829faf4f2a311a64895cc3138e7 | |
| parent | 8be1c68f809b55088c1ad00ef86cb13b0103aab0 (diff) | |
Removing old code that snuck back in
Change-Id: I52ba155e02a92eac417dba220a41acf32d3141e8
| -rw-r--r-- | nova/api/openstack/_id_translator.py | 43 | ||||
| -rw-r--r-- | nova/api/rackspace/controllers/__init__.py | 5 |
2 files changed, 0 insertions, 48 deletions
diff --git a/nova/api/openstack/_id_translator.py b/nova/api/openstack/_id_translator.py deleted file mode 100644 index dc3874a75..000000000 --- a/nova/api/openstack/_id_translator.py +++ /dev/null @@ -1,43 +0,0 @@ -from nova import datastore - - -class RackspaceAPIIdTranslator(object): - """ - Converts Rackspace API ids to and from the id format for a given - strategy. - """ - - def __init__(self, id_type, service_name): - """ - Creates a translator for ids of the given type (e.g. 'flavor'), for the - given storage service backend class name (e.g. 'LocalFlavorService'). - """ - - self._store = datastore.Redis.instance() - key_prefix = "rsapi.idtranslator.%s.%s" % (id_type, service_name) - # Forward (strategy format -> RS format) and reverse translation keys - self._fwd_key = "%s.fwd" % key_prefix - self._rev_key = "%s.rev" % key_prefix - - def to_rs_id(self, opaque_id): - """Convert an id from a strategy-specific one to a Rackspace one.""" - result = self._store.hget(self._fwd_key, str(opaque_id)) - if result: # we have a mapping from opaque to RS for this strategy - return int(result) - else: - # Store the mapping. - nextid = self._store.incr("%s.lastid" % self._fwd_key) - if self._store.hsetnx(self._fwd_key, str(opaque_id), nextid): - # If someone else didn't beat us to it, store the reverse - # mapping as well. - self._store.hset(self._rev_key, nextid, str(opaque_id)) - return nextid - else: - # Someone beat us to it; use their number instead, and - # discard nextid (which is OK -- we don't require that - # every int id be used.) - return int(self._store.hget(self._fwd_key, str(opaque_id))) - - def from_rs_id(self, rs_id): - """Convert a Rackspace id to a strategy-specific one.""" - return self._store.hget(self._rev_key, rs_id) diff --git a/nova/api/rackspace/controllers/__init__.py b/nova/api/rackspace/controllers/__init__.py deleted file mode 100644 index 052b6f365..000000000 --- a/nova/api/rackspace/controllers/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from nova.endpoint.rackspace.controllers.images import ImagesController -from nova.endpoint.rackspace.controllers.flavors import FlavorsController -from nova.endpoint.rackspace.controllers.servers import ServersController -from nova.endpoint.rackspace.controllers.sharedipgroups import \ - SharedIpGroupsController |
