def getCurrentBoxInfo():
url = client.protocol + client.localHostPort + "/status"
logging.debug("getCurrentBoxInfo: Start to get current box info. url=%s", url)
cur_client = HTTPClient()
response = cur_client.fetch(url, request_timeout=10)
if response.error:
logging.warn("getCurrentBoxInfo: Failed to get current box info. error=%s", response.error)
return None
logging.debug("getCurrentBoxInfo: Current box info. reponse.body=%r", response.body)
res = json_decode(response.body)
if res["code"] != 0:
logging.warn("getCurrentBoxInfo: Failed to get current box info. ret_value=%d", res["ret_value"])
return None
logging.debug("getCurrentBoxInfo: getstate cmd ver. app_ver=%s", res["data"]["app_ver"])
return res["data"]
评论列表
文章目录