Skip to content
Snippets Groups Projects
Commit eae12073 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

PEP8

parent 308d9590
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ def setup(interactive=True): ...@@ -19,7 +19,7 @@ def setup(interactive=True):
"ms_apikey": utils.get_conf('MS_API_KEY') "ms_apikey": utils.get_conf('MS_API_KEY')
} }
cmd_template = "./publish_zip_by_url.py -w https://{ms_url} -u %s -a {ms_apikey}".format(**options) cmd_template = "./publish_zip_by_url.py -w https://{ms_url} -u %s -a {ms_apikey}".format(**options)
#https://192.168.43.72/api/v2/search/?search=medical # https://192.168.43.72/api/v2/search/?search=medical
for c in CONTENT: for c in CONTENT:
cmd = cmd_template % c cmd = cmd_template % c
cmds.append(cmd) cmds.append(cmd)
......
...@@ -67,9 +67,9 @@ if __name__ == '__main__': ...@@ -67,9 +67,9 @@ if __name__ == '__main__':
else: else:
with open('/tmp/file.zip', 'wb') as f: with open('/tmp/file.zip', 'wb') as f:
f.write(requests.get(args.url).content) f.write(requests.get(args.url).content)
# add media with a zip # add media with a zip
#print(msc.add_media('Test multichunk upload zip', file_path='/tmp/file.zip')) # print(msc.add_media('Test multichunk upload zip', file_path='/tmp/file.zip'))
print(msc.add_media(file_path='/tmp/file.zip')) print(msc.add_media(file_path='/tmp/file.zip'))
# add user # add user
# print(msc.api('users/add/', method='post', data={'email': 'test@test.com'})) # print(msc.api('users/add/', method='post', data={'email': 'test@test.com'}))
......
...@@ -130,6 +130,7 @@ def check_mediaworker_in_whitelist(ip): ...@@ -130,6 +130,7 @@ def check_mediaworker_in_whitelist(ip):
return False return False
return True return True
all_ok = True all_ok = True
tested = False tested = False
mediaserver_ip = conf.get('NETWORK_IP') mediaserver_ip = conf.get('NETWORK_IP')
......
...@@ -351,6 +351,7 @@ def add_hosts_to_localhost(hosts: list): ...@@ -351,6 +351,7 @@ def add_hosts_to_localhost(hosts: list):
else: else:
log('/etc/hosts is already up to date.') log('/etc/hosts is already up to date.')
OPENSSL_CONFIG_TEMPLATE = """ OPENSSL_CONFIG_TEMPLATE = """
[ req ] [ req ]
...@@ -391,6 +392,7 @@ subjectAltName = @alternate_names ...@@ -391,6 +392,7 @@ subjectAltName = @alternate_names
""" """
def mkcert(domains: list, ecc: bool = True, days: int = 3650, config_tpl: str = OPENSSL_CONFIG_TEMPLATE): def mkcert(domains: list, ecc: bool = True, days: int = 3650, config_tpl: str = OPENSSL_CONFIG_TEMPLATE):
"""Generate a self-signed certificate for the domains list. """Generate a self-signed certificate for the domains list.
...@@ -420,7 +422,7 @@ def mkcert(domains: list, ecc: bool = True, days: int = 3650, config_tpl: str = ...@@ -420,7 +422,7 @@ def mkcert(domains: list, ecc: bool = True, days: int = 3650, config_tpl: str =
"-name", "secp384r1", "-name", "secp384r1",
"-out", cert_dir + "/ecparam" "-out", cert_dir + "/ecparam"
]) ])
keytype = "ec:" + cert_dir + "/ecparam" keytype = "ec:" + cert_dir + "/ecparam"
else: else:
keytype = "rsa" keytype = "rsa"
# execute openssl to generate keypair # execute openssl to generate keypair
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment