diff --git a/sysmonitor-1.3.2/script/clocktransition.py b/sysmonitor-1.3.2/script/clocktransition.py index 4db95c326f8dd5e68d9b42057615d629c96bc508..be7298ffba5d77f0a1fff03863a526dc3ff82f1c 100755 --- a/sysmonitor-1.3.2/script/clocktransition.py +++ b/sysmonitor-1.3.2/script/clocktransition.py @@ -60,9 +60,7 @@ def start_dhclient_task(cmd): def check_cmd_user(cmd_user): """check cmd user is root""" - std_cmd_user = "root" - if cmd_user: - if cmd_user == std_cmd_user: + if cmd_user == "root": return True return False @@ -83,8 +81,8 @@ def check_cmd_name(cmd_line): def reset_dhclient(): """find and kill dhclient process and start new dhclient""" - ret, ps_result = subprocess.getstatusoutput(("ps -eLwwo user,pid,args|" - "grep -w /sbin/dhclient|grep -v grep")) + ret, ps_result = subprocess.getstatusoutput("ps -eLwwo user,pid,args|" + "grep -w /sbin/dhclient|grep -v grep") if ret != 0: return