添加新接口

This commit is contained in:
tangshuangpku@hotmail.com 2016-06-06 23:07:58 +08:00
parent 2758156e0b
commit 56a801ee34
2 changed files with 5 additions and 3 deletions

View File

@ -16,7 +16,7 @@ class Container_Collector(threading.Thread):
def __init__(self,test=False): def __init__(self,test=False):
threading.Thread.__init__(self) threading.Thread.__init__(self)
self.thread_stop = False self.thread_stop = False
self.interval = 2 self.interval = 2000
self.test = test self.test = test
self.cpu_last = {} self.cpu_last = {}
self.cpu_quota = {} self.cpu_quota = {}
@ -181,7 +181,7 @@ class Collector(threading.Thread):
def __init__(self,test=False): def __init__(self,test=False):
threading.Thread.__init__(self) threading.Thread.__init__(self)
self.thread_stop = False self.thread_stop = False
self.interval = 1 self.interval = 1000
self.test=test self.test=test
return return

View File

@ -14,7 +14,9 @@ class dockletRequest():
data['token'] = session['token'] data['token'] = session['token']
logger.info ("Docklet Request: user = %s data = %s, url = %s"%(session['username'], data, url)) logger.info ("Docklet Request: user = %s data = %s, url = %s"%(session['username'], data, url))
result = requests.post(endpoint + url, data = data).json() response = requests.post(endpoint + url, data=data)
logger.info('response content: %s'%response.content)
result = response.json()
if (result.get('success', None) == "false" and result.get('reason', None) == "Unauthorized Action"): if (result.get('success', None) == "false" and result.get('reason', None) == "Unauthorized Action"):
abort(401) abort(401)
if (result.get('Unauthorized', None) == 'True'): if (result.get('Unauthorized', None) == 'True'):