Make methods static where it's possible
Change-Id: I09baf6491c84a5d4d6e3ab1261d474f7811e32d6
This commit is contained in:
parent
da4b4e85b2
commit
cb0575cafc
@ -66,7 +66,8 @@ class BaseOpenTSDBClient(object):
|
|||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def _check_meters(self, meters):
|
@staticmethod
|
||||||
|
def _check_meters(meters):
|
||||||
"""Check that meters to be put are having nice format."""
|
"""Check that meters to be put are having nice format."""
|
||||||
if type(meters) == dict:
|
if type(meters) == dict:
|
||||||
meters = [meters]
|
meters = [meters]
|
||||||
|
@ -101,7 +101,8 @@ class RESTOpenTSDBClient(base.BaseOpenTSDBClient):
|
|||||||
def get_query(self, query):
|
def get_query(self, query):
|
||||||
return self._make_query(query, 'get')
|
return self._make_query(query, 'get')
|
||||||
|
|
||||||
def process_response(self, resp):
|
@staticmethod
|
||||||
|
def process_response(resp):
|
||||||
try:
|
try:
|
||||||
res = json.loads(resp.text)
|
res = json.loads(resp.text)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
@ -199,7 +199,8 @@ class SocketOpenTSDBClient(base.BaseOpenTSDBClient):
|
|||||||
'has been collected' % self.max_uncaught_exceptions)
|
'has been collected' % self.max_uncaught_exceptions)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def compose_line_from_meter(self, m_dict):
|
@staticmethod
|
||||||
|
def compose_line_from_meter(m_dict):
|
||||||
meter_dict = copy.deepcopy(m_dict)
|
meter_dict = copy.deepcopy(m_dict)
|
||||||
tags = meter_dict.pop('tags')
|
tags = meter_dict.pop('tags')
|
||||||
tags_str = ''.join(' %s=%s' % (k, v) for k, v in six.iteritems(tags))
|
tags_str = ''.join(' %s=%s' % (k, v) for k, v in six.iteritems(tags))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user