Fix coding style
This commit is contained in:
parent
f72fabaae7
commit
1cde979a3d
@ -11,28 +11,24 @@ import sys
|
||||
################################################################################
|
||||
# Global variables and defaults
|
||||
################################################################################
|
||||
iointerfaces_allowed = [
|
||||
'async',
|
||||
iointerfaces_allowed = ['async',
|
||||
'cached',
|
||||
'direct',
|
||||
'sync',
|
||||
'dsync'
|
||||
]
|
||||
'dsync']
|
||||
|
||||
ioping_arguments = {
|
||||
'location': '',
|
||||
ioping_arguments = {'location': '',
|
||||
'cmd': 'ioping --batch',
|
||||
'count': '10',
|
||||
'interval': '1s',
|
||||
'options': ''
|
||||
}
|
||||
'options': ''}
|
||||
|
||||
|
||||
################################################################################
|
||||
# Global functions
|
||||
################################################################################
|
||||
# Function to run the shell command and capture outputs and returncode
|
||||
def capture_ioping_results():
|
||||
|
||||
if ioping_arguments['location'] == '':
|
||||
return 1, '', 'No ioping_locationectory given.'
|
||||
|
||||
@ -58,6 +54,7 @@ def ioping_output_shell():
|
||||
print(stdout)
|
||||
else:
|
||||
print(stderr)
|
||||
|
||||
return returncode
|
||||
|
||||
|
||||
@ -69,8 +66,7 @@ def ioping_output_telegraf():
|
||||
print(stderr)
|
||||
return returncode
|
||||
|
||||
ioping_statistic_keys = [
|
||||
'statistics_count',
|
||||
ioping_statistic_keys = ['statistics_count',
|
||||
'runtime',
|
||||
'iops',
|
||||
'transfer_speed',
|
||||
@ -79,8 +75,7 @@ def ioping_output_telegraf():
|
||||
'max_request_time',
|
||||
'std_deviation_request_time',
|
||||
'total_requests',
|
||||
'total_running_time'
|
||||
]
|
||||
'total_running_time']
|
||||
|
||||
try:
|
||||
ioping_statistics = dict(zip(ioping_statistic_keys, stdout.split()))
|
||||
@ -131,7 +126,6 @@ def main():
|
||||
if args.iointerface in iointerfaces_allowed:
|
||||
ioping_arguments['options'] += '--%s ' % args.iointerface
|
||||
|
||||
|
||||
if args.mode == 'shell':
|
||||
returncode = ioping_output_shell()
|
||||
elif args.mode == 'telegraf':
|
||||
|
||||
Loading…
Reference in New Issue
Block a user