[cli][supervise] added control variables
This commit is contained in:
parent
8a7a076fd7
commit
edadd5f119
1 changed files with 10 additions and 3 deletions
|
|
@ -183,12 +183,12 @@ def supervise(since):
|
||||||
|
|
||||||
logger.debug(h.__dict__())
|
logger.debug(h.__dict__())
|
||||||
|
|
||||||
post_req = requests.post(
|
post_resp = requests.post(
|
||||||
url=build_url(post_url),
|
url=build_url(post_url),
|
||||||
json=h.__dict__(),
|
json=h.__dict__(),
|
||||||
verify=False
|
verify=False
|
||||||
)
|
)
|
||||||
if post_req.status_code == 200:
|
if post_resp.status_code == 200:
|
||||||
logger.info('POST to supervisor succeeded')
|
logger.info('POST to supervisor succeeded')
|
||||||
|
|
||||||
get_path = '/'.join((
|
get_path = '/'.join((
|
||||||
|
|
@ -200,7 +200,14 @@ def supervise(since):
|
||||||
**{'path': get_path}
|
**{'path': get_path}
|
||||||
}
|
}
|
||||||
|
|
||||||
get_req = requests.get(
|
get_resp = requests.get(
|
||||||
url=build_url(get_url),
|
url=build_url(get_url),
|
||||||
verify=False
|
verify=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
control_data = get_resp.json()
|
||||||
|
if h.control(control_data):
|
||||||
|
commit()
|
||||||
|
logger.info('GET to supervisor succeded : updated values')
|
||||||
|
else:
|
||||||
|
logger.warn('Unable to set data from supervisor\n{}'.format(control_data))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue