Skip to content

Commit

Permalink
Style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaeon committed Jul 3, 2013
1 parent 7577ecd commit 73f1971
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions poller/vm-poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,6 @@

import pysphere

def return_as_is(val):
"""
Helper function, which returns property value as-is
"""
return val

def return_as_time(val):
"""
Helper function, which returns property value as time
"""
return time.strftime('%Y-%m-%d %H:%M:%S', val)

def return_as_int(val):
"""
Helper function, which returns property value as integer
"""
return int(val)

def return_as_bytes(val):
"""
Helper function, which returns property value as bytes
"""
return val * 1048576

def return_as_hz(val):
"""
Helper function, which returns property value as hz
"""
return val * 1048576

class VMPollerException(Exception):
"""
Generic VMPoller exception.
Expand Down Expand Up @@ -270,7 +235,42 @@ def get_datastore_property(self, name, url, prop):
return zabbix_datastore_properties[prop](d[prop])

return 0


def return_as_is(val):
"""
Helper function, which returns property value as-is
"""
return val

def return_as_time(val):
"""
Helper function, which returns property value as time
"""
return time.strftime('%Y-%m-%d %H:%M:%S', val)

def return_as_int(val):
"""
Helper function, which returns property value as integer
"""
return int(val)

def return_as_bytes(val):
"""
Helper function, which returns property value as bytes
"""
return val * 1048576

def return_as_hz(val):
"""
Helper function, which returns property value as hz
"""
return val * 1048576

def parse_config(conf):
if not os.path.exists(conf):
raise IOError, 'Config file %s does not exists' % conf
Expand Down

0 comments on commit 73f1971

Please sign in to comment.