Plan: fix sending per resource parameters

Patch [0] added filtering for plan parameters, to only send parameters
of resources whose type is being protected. This introduced a bug where
per resource parameters were not sent.
Fix that by apply the filtering correctly.

  [0] https://review.openstack.org/492393/

Change-Id: Ic3cdefe1a27587de4e887e509075e7c43a314262
This commit is contained in:
Yuval Brik 2017-08-13 14:19:48 +03:00
parent 90437986bc
commit f2f7e6f99b
1 changed files with 2 additions and 1 deletions

View File

@ -62,7 +62,8 @@ class CreateProtectionPlanForm(horizon_forms.SelfHandlingForm):
resources = json.loads(data["resources"])
types = {resource["type"] for resource in resources}
parameters = json.loads(data["parameters"])
parameters = {k: v for k, v in parameters.items() if k in types}
parameters = {k: v for k, v in parameters.items()
if k.split("#")[0] in types}
new_plan = karborclient.plan_create(
request,
data["name"],