From: Tomas Sedovic Date: Sat, 5 May 2012 01:00:16 +0000 (+0200) Subject: Remove obsoleted metadata files X-Git-Tag: 2014.1~1877 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=da366b43b91c380cea2f7e20b63e0e536b9fadcc;p=openstack-build%2Fheat-build.git Remove obsoleted metadata files Signed-off-by: Tomas Sedovic --- diff --git a/heat/metadata/api/v1/metadata.py b/heat/metadata/api/v1/metadata.py index 77fc7ad5..b0fe3edc 100644 --- a/heat/metadata/api/v1/metadata.py +++ b/heat/metadata/api/v1/metadata.py @@ -20,9 +20,6 @@ from webob.exc import Response from heat.common import wsgi from heat import context -from heat.metadata import db as db_api -from heat.metadata.db import (ConflictError, StackNotFoundError, - ResourceNotFoundError) from heat import rpc diff --git a/heat/metadata/db.py b/heat/metadata/db.py deleted file mode 100644 index 732422ca..00000000 --- a/heat/metadata/db.py +++ /dev/null @@ -1,64 +0,0 @@ -DB = {} - - -class ConflictError(Exception): - pass - -class StackNotFoundError(Exception): - pass - -class ResourceNotFoundError(Exception): - pass - - -def list_stacks(): - return DB.keys() - -def create_stack(name, stack): - global DB - if name in DB: - raise ConflictError(name) - data = {} - # TODO(shadower): validate the stack input format - data['name'] = name - data['heat_id'] = stack['id'] - data['resources'] = {} - DB[name] = data - return data - -def list_resources(stack_name): - if not stack_name in DB: - raise StackNotFoundError(stack_name) - stack = DB[stack_name] - try: - resources = stack['resources'].keys() - except: - resources = [] - return resources - -def get_resource(stack_name, resource_id): - if not stack_name in DB: - raise StackNotFoundError(stack_name) - stack = DB[stack_name] - - if not resource_id in stack['resources']: - raise ResourceNotFoundError(resource_id) - return stack['resources'][resource_id] - -def create_resource_metadata(stack_name, resource_id, metadata): - if not stack_name in DB: - raise StackNotFoundError(stack_name) - stack = DB[stack_name] - - if resource_id in stack['resources']: - raise ConflictError(resource_id) - stack['resources'][resource_id] = metadata - -def update_resource_metadata(stack_name, resource_id, metadata): - if not stack_name in DB: - raise StackNotFoundError(stack_name) - stack = DB[stack_name] - - if not resource_id in stack['resources']: - raise ResourceNotFoundError(resource_id) - stack['resources'][resource_id] = metadata