Update waitcondition API to use signal RPC interface

Update the call to the engine to use resource_signal instead
of metadata_update, since they do basically the same thing
and it would be good to converge on one interface for resource
signalling.

Change-Id: I1385f9f4539eeb7907370e31af5ea2f86870cbe9
blueprint: native-waitcondition
This commit is contained in:
Steven Hardy 2014-06-19 15:47:21 +01:00
parent a60f2722f8
commit f2f2697c9d
2 changed files with 1 additions and 15 deletions

View File

@ -72,7 +72,7 @@ class API(wsgi.Router):
signal_controller = signal.create_resource(conf)
mapper.connect('/waitcondition/{arn:.*}',
controller=signal_controller,
action='update_waitcondition',
action='signal',
conditions=dict(method=['PUT']))
mapper.connect('/signal/{arn:.*}',
controller=signal_controller,

View File

@ -22,20 +22,6 @@ class SignalController(object):
self.options = options
self.rpc_client = rpc_client.EngineClient()
def update_waitcondition(self, req, body, arn):
con = req.context
identity = identifier.ResourceIdentifier.from_arn(arn)
try:
md = self.rpc_client.metadata_update(
con,
stack_identity=dict(identity.stack()),
resource_name=identity.resource_name,
metadata=body)
except Exception as ex:
return exception.map_remote_error(ex)
return {'resource': identity.resource_name, 'metadata': md}
def signal(self, req, arn, body=None):
con = req.context
identity = identifier.ResourceIdentifier.from_arn(arn)