new url
This commit is contained in:
parent
3c527da97b
commit
afdf049a26
|
@ -10,8 +10,8 @@ from cucchiaiata.i18n import _
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
try:
|
try:
|
||||||
if argv[1] in ['session.server.configure',
|
if argv[1] in ['setting.session.server.configure',
|
||||||
'session.servermodel.configure']:
|
'setting.session.servermodel.configure']:
|
||||||
Configuration().get()
|
Configuration().get()
|
||||||
else:
|
else:
|
||||||
parser = Parser()
|
parser = Parser()
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Common:
|
||||||
headers = {'Authorization':'Bearer {}'.format(token)}
|
headers = {'Authorization':'Bearer {}'.format(token)}
|
||||||
req = get(url,
|
req = get(url,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=False)
|
verify=config.allow_insecure_https)
|
||||||
code = req.status_code
|
code = req.status_code
|
||||||
if code != 200:
|
if code != 200:
|
||||||
raise Exception(self.get_error_from_http(req))
|
raise Exception(self.get_error_from_http(req))
|
||||||
|
@ -62,4 +62,4 @@ def send_data(message: str,
|
||||||
if 'reason' in response['error']['kwargs']:
|
if 'reason' in response['error']['kwargs']:
|
||||||
raise Exception("{}".format(response['error']['kwargs']['reason']))
|
raise Exception("{}".format(response['error']['kwargs']['reason']))
|
||||||
raise Exception('erreur inconnue')
|
raise Exception('erreur inconnue')
|
||||||
return(response['response'])
|
return response['response']
|
||||||
|
|
|
@ -25,11 +25,11 @@ class ConfigAPI(Config):
|
||||||
|
|
||||||
class Configuration(Common):
|
class Configuration(Common):
|
||||||
def configure_server(self):
|
def configure_server(self):
|
||||||
if self.message == 'session.server.configure':
|
if self.message == 'setting.session.server.configure':
|
||||||
type = 'server'
|
type = 'server'
|
||||||
else:
|
else:
|
||||||
type = 'servermodel'
|
type = 'servermodel'
|
||||||
url = '{}/config/{}/{}'.format(self.cucchiaiata_config.remote_url,
|
url = '{}/setting/{}/{}'.format(self.cucchiaiata_config.remote_url,
|
||||||
type,
|
type,
|
||||||
self.session_id)
|
self.session_id)
|
||||||
tconfig = self.remote_json_to_config(url,
|
tconfig = self.remote_json_to_config(url,
|
||||||
|
|
Loading…
Reference in New Issue