diff options
author | Thomas Duval <thomas.duval@orange.com> | 2018-10-05 16:54:37 +0200 |
---|---|---|
committer | Thomas Duval <thomas.duval@orange.com> | 2018-10-05 16:58:48 +0200 |
commit | 2e35a7e46f0929438c1c206e3116caa829f07dc6 (patch) | |
tree | 759a83b3dfefe70faeada1c3af7377f4cd89b8eb /python_moonclient/python_moonclient/core/json_import.py | |
parent | 2dbe655587ca98b67c1a3e3798c63fd47229adc0 (diff) |
Update code to 4.6 official version
Change-Id: Ibd0da0e476e24b2685f54693efc11f7a58d40a62
Diffstat (limited to 'python_moonclient/python_moonclient/core/json_import.py')
-rw-r--r-- | python_moonclient/python_moonclient/core/json_import.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python_moonclient/python_moonclient/core/json_import.py b/python_moonclient/python_moonclient/core/json_import.py index a724476b..b65ec39b 100644 --- a/python_moonclient/python_moonclient/core/json_import.py +++ b/python_moonclient/python_moonclient/core/json_import.py @@ -3,12 +3,12 @@ import requests import copy from python_moonclient.core import config - -logger = logging.getLogger("moonclient.core.import_json") +LOGGER = logging.getLogger("moonclient.core.import_json") URL = None HEADERS = None + def init(consul_host, consul_port): conf_data = config.get_config_data(consul_host, consul_port) global URL, HEADERS @@ -23,7 +23,7 @@ def import_json(file_name): files = {'file': open(file_name, 'rb')} req = requests.post(URL.format("/import"), files=files) result = req.json() - if isinstance(result,dict) and "message" in result: + if isinstance(result, dict) and "message" in result: req.reason = result["message"] req.raise_for_status() - return result
\ No newline at end of file + return result |