Add a filter processing for the parameter of restore

Now the protection service only check the keys 'username'
and 'password' in the parameter of restore. It should check
more keys.

Change-Id: I902e26456ab2c166cd927fed786f0c833c138ff0
This commit is contained in:
chenying 2016-09-21 15:55:50 +08:00
parent 3771bdd1a9
commit b0dc050b2e
1 changed files with 3 additions and 1 deletions

View File

@ -60,7 +60,9 @@ class BaseProtectionPlugin(ProtectionPlugin):
requires = parameters.keys()
requires.append('checkpoint')
elif operation == constants.OPERATION_RESTORE:
parameters.update(context.parameters)
parameters.update(context.parameters.get(resource.type, {}))
res_params = resource.type + '#' + str(resource.id)
parameters.update(context.parameters.get(res_params, {}))
parameters['checkpoint'] = context.checkpoint
parameters['heat_template'] = context.heat_template
inject = parameters