Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Good to handle when no ouput file/interval duration is given #3

Open
Lord-Of-The-Sky opened this issue Jul 21, 2017 · 0 comments
Open

Comments

@Lord-Of-The-Sky
Copy link

system_monitor crashes when -o/-i are not provided by he user.

Command : system_monitor system_monitor -p "systemd glusterfsd glusterd"

<When -o is missing> :
[root@gqas013 ~]# system_monitor system_monitor -p "systemd glusterfsd glusterd"
Traceback (most recent call last):
File "/usr/bin/system_monitor", line 9, in
load_entry_point('system-monitor==0.1', 'console_scripts', 'system_monitor')()
File "/usr/lib/python2.7/site-packages/system_monitor/system_monitor.py", line 281, in main
args.func(args)
File "/usr/lib/python2.7/site-packages/system_monitor/system_monitor.py", line 131, in system_monitor
if os.path.exists(filename):
File "/usr/lib64/python2.7/genericpath.py", line 18, in exists
os.stat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found
[root@gqas013 ~]#

<When -i is missing> :

Command : system_monitor system_monitor -p "systemd glusterfsd glusterd" -o "/tmp/node_1.xlsx"
Waiting for None seconds to take samples
Traceback (most recent call last):
File "/usr/bin/system_monitor", line 9, in
load_entry_point('system-monitor==0.1', 'console_scripts', 'system_monitor')()
File "/usr/lib/python2.7/site-packages/system_monitor/system_monitor.py", line 281, in main
args.func(args)
File "/usr/lib/python2.7/site-packages/system_monitor/system_monitor.py", line 149, in system_monitor
time.sleep(int(interval))
TypeError: int() argument must be a string or a number, not 'NoneType'
[root@gqas013 ~]#
[root@gqas013 ~]#

The help menu says that both of them default to None,so IMHO it's be nice to handle :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant