diff --git a/octaviaclient/osc/v2/listener.py b/octaviaclient/osc/v2/listener.py index 6ea388c..987b518 100644 --- a/octaviaclient/osc/v2/listener.py +++ b/octaviaclient/osc/v2/listener.py @@ -215,6 +215,7 @@ class CreateListener(command.ShowOne): '--hsts-include-subdomains', action='store_true', dest='hsts_include_subdomains', + default=None, help="Define whether the includeSubDomains directive should be " "added to the Strict-Transport-Security HTTP response " "header." @@ -223,6 +224,7 @@ class CreateListener(command.ShowOne): '--hsts-preload', action='store_true', dest='hsts_preload', + default=None, help="Define whether the preload directive should be " "added to the Strict-Transport-Security HTTP response " "header." diff --git a/octaviaclient/tests/unit/osc/v2/test_listener.py b/octaviaclient/tests/unit/osc/v2/test_listener.py index 3e00d4d..d17a21e 100644 --- a/octaviaclient/tests/unit/osc/v2/test_listener.py +++ b/octaviaclient/tests/unit/osc/v2/test_listener.py @@ -195,6 +195,9 @@ class TestListenerCreate(TestListener): ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) + self.assertIsNone(parsed_args.hsts_include_subdomains) + self.assertIsNone(parsed_args.hsts_preload) + self.assertIsNone(parsed_args.hsts_max_age) self.cmd.take_action(parsed_args) self.api_mock.listener_create.assert_called_with( json={'listener': self.listener_info}) diff --git a/releasenotes/notes/remove-unneeded-attributes-in-listener-create-2e7cb2de281ac7fe.yaml b/releasenotes/notes/remove-unneeded-attributes-in-listener-create-2e7cb2de281ac7fe.yaml new file mode 100644 index 0000000..b405f3a --- /dev/null +++ b/releasenotes/notes/remove-unneeded-attributes-in-listener-create-2e7cb2de281ac7fe.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Removed unneeded attributes that could have been passed to the API when + calling "listener create", hsts_include_subdomains and hsts_preload were + passed even when not used. + It fixes an issue when using a recent python-octaviaclient release with + older Octavia releases (without this HSTS feature).