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:
parent
a60f2722f8
commit
f2f2697c9d
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue