Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restricted method to http and https #298

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions acos_client/v30/slb/hm.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def get(self, name, **kwargs):

def _set(self, action, name, mon_method, interval, timeout, max_retries,
method=None, url=None, expect_code=None, port=None, ipv4=None, update=False,
**kwargs):
disable_sslv2=False, **kwargs):
params = {
"monitor": {
"name": name,
Expand All @@ -82,8 +82,12 @@ def _set(self, action, name, mon_method, interval, timeout, max_retries,
"override-ipv4": ipv4
}
}
if method:
params['monitor']['method'][mon_method]['url-type'] = method
if mon_method in ['http', 'https']:
if method:
params['monitor']['method'][mon_method]['url-type'] = method
if mon_method in ['https']:
JLau1596 marked this conversation as resolved.
Show resolved Hide resolved
if disable_sslv2:
params['monitor']['method'][mon_method]['disable-sslv2hello'] = disable_sslv2
if url:
params['monitor']['method'][mon_method]['url-path'] = url
if expect_code:
Expand All @@ -96,7 +100,6 @@ def _set(self, action, name, mon_method, interval, timeout, max_retries,
k = '%s-port' % mon_method
params['monitor']['method'][mon_method][k] = int(port)
params['monitor']['override-port'] = int(port)

# TODO(mdurrant) : Might have to get tricky with JSON structures
# ... due to 'mon_method' stuff.
config_defaults = kwargs.get("config_defaults")
Expand Down