From eae120734dc3eedb44008e3b5da34cd791eb464b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu> Date: Tue, 9 Apr 2019 15:11:27 +0200 Subject: [PATCH] PEP8 --- 13.Demokit/1.Deploy_demokit/0_setup.py | 2 +- 13.Demokit/1.Deploy_demokit/publish_zip_by_url.py | 6 +++--- tests/test_mediaworker.py | 1 + utils.py | 4 +++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/13.Demokit/1.Deploy_demokit/0_setup.py b/13.Demokit/1.Deploy_demokit/0_setup.py index 2eaa4e50..b567c78e 100644 --- a/13.Demokit/1.Deploy_demokit/0_setup.py +++ b/13.Demokit/1.Deploy_demokit/0_setup.py @@ -19,7 +19,7 @@ def setup(interactive=True): "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) - #https://192.168.43.72/api/v2/search/?search=medical + # https://192.168.43.72/api/v2/search/?search=medical for c in CONTENT: cmd = cmd_template % c cmds.append(cmd) diff --git a/13.Demokit/1.Deploy_demokit/publish_zip_by_url.py b/13.Demokit/1.Deploy_demokit/publish_zip_by_url.py index bde7bb55..27e8682e 100755 --- a/13.Demokit/1.Deploy_demokit/publish_zip_by_url.py +++ b/13.Demokit/1.Deploy_demokit/publish_zip_by_url.py @@ -67,9 +67,9 @@ if __name__ == '__main__': else: with open('/tmp/file.zip', 'wb') as f: f.write(requests.get(args.url).content) - # add media with a zip - #print(msc.add_media('Test multichunk upload zip', file_path='/tmp/file.zip')) - print(msc.add_media(file_path='/tmp/file.zip')) + # add media with a zip + # print(msc.add_media('Test multichunk upload zip', file_path='/tmp/file.zip')) + print(msc.add_media(file_path='/tmp/file.zip')) # add user # print(msc.api('users/add/', method='post', data={'email': 'test@test.com'})) diff --git a/tests/test_mediaworker.py b/tests/test_mediaworker.py index 3d04a30c..bee6aa0a 100755 --- a/tests/test_mediaworker.py +++ b/tests/test_mediaworker.py @@ -130,6 +130,7 @@ def check_mediaworker_in_whitelist(ip): return False return True + all_ok = True tested = False mediaserver_ip = conf.get('NETWORK_IP') diff --git a/utils.py b/utils.py index 431d4b84..45606004 100644 --- a/utils.py +++ b/utils.py @@ -351,6 +351,7 @@ def add_hosts_to_localhost(hosts: list): else: log('/etc/hosts is already up to date.') + OPENSSL_CONFIG_TEMPLATE = """ [ req ] @@ -391,6 +392,7 @@ subjectAltName = @alternate_names """ + 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. @@ -420,7 +422,7 @@ def mkcert(domains: list, ecc: bool = True, days: int = 3650, config_tpl: str = "-name", "secp384r1", "-out", cert_dir + "/ecparam" ]) - keytype = "ec:" + cert_dir + "/ecparam" + keytype = "ec:" + cert_dir + "/ecparam" else: keytype = "rsa" # execute openssl to generate keypair -- GitLab