Set default value for HSTS options to None
The default value of these options was False, it means that octaviaclient sends {'attr': False} to the Octavia API even if it is not required. Setting the default value to None, the attribute will not be send when it is not needed. It also fixes a potential issue when using recent python-octaviaclient release with an old octavia release that doesn't support HSTS. Closes-Bug: #2037253 Change-Id: Ica89bbd257216ef423afc44e0c81498037aece20
This commit is contained in:
parent
7ce63497a9
commit
db6b62ebdd
@ -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."
|
||||
|
@ -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})
|
||||
|
@ -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).
|
Loading…
Reference in New Issue
Block a user