diff --git a/neutronclient/osc/v2/fwaas/firewallpolicy.py b/neutronclient/osc/v2/fwaas/firewallpolicy.py index e049698f7..cfcc3c1df 100644 --- a/neutronclient/osc/v2/fwaas/firewallpolicy.py +++ b/neutronclient/osc/v2/fwaas/firewallpolicy.py @@ -235,7 +235,7 @@ class FirewallPolicyInsertRule(command.Command): policy_id = client.find_firewall_policy( parsed_args.firewall_policy)['id'] body = self.args2body(parsed_args) - client.insert_rule_into_policy(policy_id, body) + client.insert_rule_into_policy(policy_id, **body) rule_id = body['firewall_rule_id'] policy = parsed_args.firewall_policy print((_('Inserted firewall rule %(rule)s in firewall policy ' @@ -264,7 +264,7 @@ class FirewallPolicyRemoveRule(command.Command): parsed_args.firewall_policy)['id'] fwr_id = _get_required_firewall_rule(client, parsed_args) body = {'firewall_rule_id': fwr_id} - client.remove_rule_from_policy(policy_id, body) + client.remove_rule_from_policy(policy_id, **body) rule_id = body['firewall_rule_id'] policy = parsed_args.firewall_policy print((_('Removed firewall rule %(rule)s from firewall policy ' diff --git a/neutronclient/tests/unit/osc/v2/fwaas/test_firewallpolicy.py b/neutronclient/tests/unit/osc/v2/fwaas/test_firewallpolicy.py index 7d49879dc..fe385a0cb 100644 --- a/neutronclient/tests/unit/osc/v2/fwaas/test_firewallpolicy.py +++ b/neutronclient/tests/unit/osc/v2/fwaas/test_firewallpolicy.py @@ -507,12 +507,12 @@ class TestFirewallPolicyInsertRule(TestFirewallPolicy): parsed_args = self.check_parser(self.cmd, arglist, verifylist) result = self.cmd.take_action(parsed_args) - self.mocked.assert_called_once_with( - target, { - 'firewall_rule_id': rule, - 'insert_before': before, - 'insert_after': after - }) + body = { + 'firewall_rule_id': rule, + 'insert_before': before, + 'insert_after': after + } + self.mocked.assert_called_once_with(target, **body) self.assertIsNone(result) self.assertEqual(1, self.networkclient.find_firewall_policy.call_count) self.assertEqual(3, self.networkclient.find_firewall_rule.call_count) @@ -560,8 +560,8 @@ class TestFirewallPolicyRemoveRule(TestFirewallPolicy): ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) result = self.cmd.take_action(parsed_args) - self.mocked.assert_called_once_with( - target, {'firewall_rule_id': rule}) + body = {'firewall_rule_id': rule} + self.mocked.assert_called_once_with(target, **body) self.assertIsNone(result) self.assertEqual(1, self.networkclient.find_firewall_policy.call_count) self.assertEqual(1, self.networkclient.find_firewall_rule.call_count)