Remove obsoleted metadata files

Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
This commit is contained in:
Tomas Sedovic 2012-05-05 03:00:16 +02:00
parent 9d69b20402
commit da366b43b9
2 changed files with 0 additions and 67 deletions

View File

@ -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

View File

@ -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