summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Gordon <jogo@cloudscaling.com>2012-06-11 15:10:40 -0700
committerJoe Gordon <jogo@cloudscaling.com>2012-06-12 11:41:51 -0700
commit1a2efbaaf89303cc5977b832b784c23ad219b0d7 (patch)
tree129e92958b573e737ffa8e00745578c79ca66c7f
parent6555c5a8728c5eed9fc104894fdb988a5c9d3e0b (diff)
Remove unused DB calls
Fixes bug 1012301: Remove unused Cells code Change-Id: I7e78e7c4ae3b099c775be2acc54b37f1e1b9883e
-rw-r--r--nova/db/api.py43
-rw-r--r--nova/db/sqlalchemy/api.py70
-rw-r--r--nova/db/sqlalchemy/models.py19
-rw-r--r--nova/exception.py4
4 files changed, 0 insertions, 136 deletions
diff --git a/nova/db/api.py b/nova/db/api.py
index 88d28194e..cb3be7bfe 100644
--- a/nova/db/api.py
+++ b/nova/db/api.py
@@ -188,11 +188,6 @@ def service_update(context, service_id, values):
###################
-def compute_node_get(context, compute_id):
- """Get a computeNode or raise if it does not exist."""
- return IMPL.compute_node_get(context, compute_id)
-
-
def compute_node_get_all(context):
"""Get all computeNodes."""
return IMPL.compute_node_get_all(context)
@@ -1353,11 +1348,6 @@ def user_get(context, id):
return IMPL.user_get(context, id)
-def user_get_by_uid(context, uid):
- """Get user by uid."""
- return IMPL.user_get_by_uid(context, uid)
-
-
def user_get_by_access_key(context, access_key):
"""Get user by access key."""
return IMPL.user_get_by_access_key(context, access_key)
@@ -1474,11 +1464,6 @@ def console_pool_create(context, values):
return IMPL.console_pool_create(context, values)
-def console_pool_get(context, pool_id):
- """Get a console pool."""
- return IMPL.console_pool_get(context, pool_id)
-
-
def console_pool_get_by_host_type(context, compute_host, proxy_host,
console_type):
"""Fetch a console pool for a given proxy host, compute host, and type."""
@@ -1557,34 +1542,6 @@ def instance_type_destroy(context, name):
####################
-def cell_create(context, values):
- """Create a new child Cell entry."""
- return IMPL.cell_create(context, values)
-
-
-def cell_update(context, cell_id, values):
- """Update a child Cell entry."""
- return IMPL.cell_update(context, cell_id, values)
-
-
-def cell_delete(context, cell_id):
- """Delete a child Cell."""
- return IMPL.cell_delete(context, cell_id)
-
-
-def cell_get(context, cell_id):
- """Get a specific child Cell."""
- return IMPL.cell_get(context, cell_id)
-
-
-def cell_get_all(context):
- """Get all child Cells."""
- return IMPL.cell_get_all(context)
-
-
-####################
-
-
def instance_metadata_get(context, instance_uuid):
"""Get all metadata for an instance."""
return IMPL.instance_metadata_get(context, instance_uuid)
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py
index 44f11098e..d0203f29e 100644
--- a/nova/db/sqlalchemy/api.py
+++ b/nova/db/sqlalchemy/api.py
@@ -474,18 +474,6 @@ def service_update(context, service_id, values):
@require_admin_context
-def compute_node_get(context, compute_id, session=None):
- result = model_query(context, models.ComputeNode, session=session).\
- filter_by(id=compute_id).\
- first()
-
- if not result:
- raise exception.ComputeHostNotFound(host=compute_id)
-
- return result
-
-
-@require_admin_context
def compute_node_get_all(context, session=None):
return model_query(context, models.ComputeNode, session=session).\
options(joinedload('service')).\
@@ -3841,17 +3829,6 @@ def console_pool_create(context, values):
return pool
-def console_pool_get(context, pool_id):
- result = model_query(context, models.ConsolePool, read_deleted="no").\
- filter_by(id=pool_id).\
- first()
-
- if not result:
- raise exception.ConsolePoolNotFound(pool_id=pool_id)
-
- return result
-
-
def console_pool_get_by_host_type(context, compute_host, host,
console_type):
@@ -4092,53 +4069,6 @@ def instance_type_destroy(context, name):
'updated_at': literal_column('updated_at')})
-####################
-
-
-@require_admin_context
-def cell_create(context, values):
- cell = models.Cell()
- cell.update(values)
- cell.save()
- return cell
-
-
-def _cell_get_by_id_query(context, cell_id, session=None):
- return model_query(context, models.Cell, session=session).\
- filter_by(id=cell_id)
-
-
-@require_admin_context
-def cell_update(context, cell_id, values):
- cell = cell_get(context, cell_id)
- cell.update(values)
- cell.save()
- return cell
-
-
-@require_admin_context
-def cell_delete(context, cell_id):
- session = get_session()
- with session.begin():
- _cell_get_by_id_query(context, cell_id, session=session).\
- delete()
-
-
-@require_admin_context
-def cell_get(context, cell_id):
- result = _cell_get_by_id_query(context, cell_id).first()
-
- if not result:
- raise exception.CellNotFound(cell_id=cell_id)
-
- return result
-
-
-@require_admin_context
-def cell_get_all(context):
- return model_query(context, models.Cell, read_deleted="no").all()
-
-
########################
# User-provided metadata
diff --git a/nova/db/sqlalchemy/models.py b/nova/db/sqlalchemy/models.py
index 0a3f07b9a..be3e892c1 100644
--- a/nova/db/sqlalchemy/models.py
+++ b/nova/db/sqlalchemy/models.py
@@ -278,9 +278,6 @@ class Instance(BASE, NovaBase):
# EC2 disable_api_termination
disable_terminate = Column(Boolean(), default=False, nullable=False)
- # OpenStack compute cell name
- cell_name = Column(String(255))
-
class InstanceInfoCache(BASE, NovaBase):
"""
@@ -901,22 +898,6 @@ class InstanceTypeExtraSpecs(BASE, NovaBase):
'InstanceTypeExtraSpecs.deleted == False)')
-class Cell(BASE, NovaBase):
- """Represents parent and child cells of this cell."""
- __tablename__ = 'cells'
- id = Column(Integer, primary_key=True)
- name = Column(String(255))
- api_url = Column(String(255))
- username = Column(String(255))
- password = Column(String(255))
- weight_offset = Column(Float(), default=0.0)
- weight_scale = Column(Float(), default=1.0)
- is_parent = Column(Boolean())
- rpc_host = Column(String(255))
- rpc_port = Column(Integer())
- rpc_virtual_host = Column(String(255))
-
-
class AggregateHost(BASE, NovaBase):
"""Represents a host that is member of an aggregate."""
__tablename__ = 'aggregate_hosts'
diff --git a/nova/exception.py b/nova/exception.py
index e5ae3d267..2c43d36f4 100644
--- a/nova/exception.py
+++ b/nova/exception.py
@@ -807,10 +807,6 @@ class FlavorNotFound(NotFound):
message = _("Flavor %(flavor_id)s could not be found.")
-class CellNotFound(NotFound):
- message = _("Cell %(cell_id)s could not be found.")
-
-
class SchedulerHostFilterNotFound(NotFound):
message = _("Scheduler Host Filter %(filter_name)s could not be found.")