diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-04-27 22:01:41 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-04-27 22:01:41 +0200 |
commit | 867a0b71acc3f1cbbcfad553952bdbc82070ae4b (patch) | |
tree | acd9154f6ba9971f6e4178fa1b44bbff09eb8f75 | |
parent | 83eea4284a61a70e62252e7ce21728ddaa4b206b (diff) | |
download | vyos-1x-867a0b71acc3f1cbbcfad553952bdbc82070ae4b.tar.gz vyos-1x-867a0b71acc3f1cbbcfad553952bdbc82070ae4b.zip |
powerctl: T2010: bugfix "TypeError: 'NoneType' object is not subscriptable"
Commit d6384b2 ("powerctl: T2010: report reboot time in current timezone")
added a migrator from UTC to local timezone but reading in the base value up
for conversion was done outside the proper if/else clause leading to a:
TypeError: 'NoneType' object is not subscriptable
-rwxr-xr-x | src/op_mode/powerctrl.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/op_mode/powerctrl.py b/src/op_mode/powerctrl.py index b2fb5fe5a..69af427ec 100755 --- a/src/op_mode/powerctrl.py +++ b/src/op_mode/powerctrl.py @@ -71,8 +71,8 @@ def get_shutdown_status(): def check_shutdown(): output = get_shutdown_status() - dt = datetime.strptime(output['DATETIME'], '%Y-%m-%d %H:%M:%S') if output and 'MODE' in output: + dt = datetime.strptime(output['DATETIME'], '%Y-%m-%d %H:%M:%S') if output['MODE'] == 'reboot': print("Reboot is scheduled", utc2local(dt)) elif output['MODE'] == 'poweroff': |