diff --git a/octaviaclient/osc/v2/l7rule.py b/octaviaclient/osc/v2/l7rule.py index 8bf6722..a888a46 100644 --- a/octaviaclient/osc/v2/l7rule.py +++ b/octaviaclient/osc/v2/l7rule.py @@ -127,7 +127,7 @@ class CreateL7Rule(command.ShowOne): data = { 'rule': ( self.app.client_manager.load_balancer.l7rule_show( - l7policy_id, data['rule']['id'])) + data['rule']['id'], l7policy_id)) } formatters = {'tags': v2_utils.FlatListColumn} diff --git a/octaviaclient/tests/unit/osc/v2/test_l7rule.py b/octaviaclient/tests/unit/osc/v2/test_l7rule.py index 3c3eeac..5f15d0b 100644 --- a/octaviaclient/tests/unit/osc/v2/test_l7rule.py +++ b/octaviaclient/tests/unit/osc/v2/test_l7rule.py @@ -267,6 +267,8 @@ class TestL7RuleCreate(TestL7Rule): sleep_time=mock.ANY, status_field='provisioning_status') + self.api_mock.l7rule_show.assert_called_with(mock.ANY, self._l7po.id) + @mock.patch('octaviaclient.osc.v2.utils.get_l7rule_attrs') def test_l7rule_create_with_tag(self, mock_attrs): mock_attrs.return_value = { diff --git a/releasenotes/notes/fix-l7rule-create-wait-1f087c17a82eedeb.yaml b/releasenotes/notes/fix-l7rule-create-wait-1f087c17a82eedeb.yaml new file mode 100644 index 0000000..8b3cf39 --- /dev/null +++ b/releasenotes/notes/fix-l7rule-create-wait-1f087c17a82eedeb.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixed a bug when using the ``--wait`` flag with the ``l7rule create`` + command, it displayed an error message even when the command succeeded.