From afdf049a26370aba493d0de22cfe6dcb83e4ce84 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Tue, 10 Mar 2020 12:21:49 +0100 Subject: [PATCH] new url --- script/cucchiaiata | 4 ++-- src/cucchiaiata/common.py | 4 ++-- src/cucchiaiata/configuration.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/script/cucchiaiata b/script/cucchiaiata index cf46432..39be057 100755 --- a/script/cucchiaiata +++ b/script/cucchiaiata @@ -10,8 +10,8 @@ from cucchiaiata.i18n import _ def main(): try: - if argv[1] in ['session.server.configure', - 'session.servermodel.configure']: + if argv[1] in ['setting.session.server.configure', + 'setting.session.servermodel.configure']: Configuration().get() else: parser = Parser() diff --git a/src/cucchiaiata/common.py b/src/cucchiaiata/common.py index 7132de0..e67ddef 100644 --- a/src/cucchiaiata/common.py +++ b/src/cucchiaiata/common.py @@ -41,7 +41,7 @@ class Common: headers = {'Authorization':'Bearer {}'.format(token)} req = get(url, headers=headers, - verify=False) + verify=config.allow_insecure_https) code = req.status_code if code != 200: raise Exception(self.get_error_from_http(req)) @@ -62,4 +62,4 @@ def send_data(message: str, if 'reason' in response['error']['kwargs']: raise Exception("{}".format(response['error']['kwargs']['reason'])) raise Exception('erreur inconnue') - return(response['response']) + return response['response'] diff --git a/src/cucchiaiata/configuration.py b/src/cucchiaiata/configuration.py index d30865d..a9d844e 100644 --- a/src/cucchiaiata/configuration.py +++ b/src/cucchiaiata/configuration.py @@ -25,11 +25,11 @@ class ConfigAPI(Config): class Configuration(Common): def configure_server(self): - if self.message == 'session.server.configure': + if self.message == 'setting.session.server.configure': type = 'server' else: type = 'servermodel' - url = '{}/config/{}/{}'.format(self.cucchiaiata_config.remote_url, + url = '{}/setting/{}/{}'.format(self.cucchiaiata_config.remote_url, type, self.session_id) tconfig = self.remote_json_to_config(url,