Fix coding style

This commit is contained in:
Thomas Gebert 2024-12-10 09:47:04 +01:00
parent f72fabaae7
commit 1cde979a3d

View File

@ -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':