aboutsummaryrefslogtreecommitdiffstats
path: root/python_moonclient/python_moonclient/core/slaves.py
diff options
context:
space:
mode:
Diffstat (limited to 'python_moonclient/python_moonclient/core/slaves.py')
-rw-r--r--python_moonclient/python_moonclient/core/slaves.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/python_moonclient/python_moonclient/core/slaves.py b/python_moonclient/python_moonclient/core/slaves.py
index 112b56f3..77b127c1 100644
--- a/python_moonclient/python_moonclient/core/slaves.py
+++ b/python_moonclient/python_moonclient/core/slaves.py
@@ -3,8 +3,7 @@ import requests
from python_moonclient.core import config
from python_moonclient.core.check_tools import *
-logger = logging.getLogger("moonclient.core.slaves")
-
+LOGGER = logging.getLogger("moonclient.core.slaves")
URL = None
HEADERS = None
@@ -20,8 +19,6 @@ def init(consul_host, consul_port):
HEADERS = {"content-type": "application/json"}
-
-
def get_slaves():
req = requests.get(URL.format("/slaves"))
req.raise_for_status()
@@ -36,10 +33,10 @@ def set_slave(name):
req = requests.patch(URL.format("/slaves/{}".format(name)),
headers=HEADERS,
json={
- "op": "replace",
- "variable": "configured",
- "value": True
- })
+ "op": "replace",
+ "variable": "configured",
+ "value": True
+ })
req.raise_for_status()
result = req.json()
check_slaves_in_result(result)
@@ -52,10 +49,10 @@ def delete_slave(name):
req = requests.patch(URL.format("/slaves/{}".format(name)),
headers=HEADERS,
json={
- "op": "replace",
- "variable": "configured",
- "value": False
- })
+ "op": "replace",
+ "variable": "configured",
+ "value": False
+ })
req.raise_for_status()
result = req.json()
check_slaves_in_result(result)