diff options
author | Scott Moser <smoser@ubuntu.com> | 2013-10-17 16:46:39 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2013-10-17 16:46:39 -0400 |
commit | b27fab81c99fcb05f4c633bad62d4151edc702e6 (patch) | |
tree | 62ec24a13feea1922a3d570745f17a6136400219 /cloudinit | |
parent | 85d4fff9f7f7e8ffadca91258a25b5d2b3f43fd9 (diff) | |
parent | ad71260b802526d6751d4726a2efda62515fbf24 (diff) | |
download | vyos-cloud-init-b27fab81c99fcb05f4c633bad62d4151edc702e6.tar.gz vyos-cloud-init-b27fab81c99fcb05f4c633bad62d4151edc702e6.zip |
fix power_state_change config module so that example works, improve doc
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/config/cc_power_state_change.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cloudinit/config/cc_power_state_change.py b/cloudinit/config/cc_power_state_change.py index 188047e5..e3150808 100644 --- a/cloudinit/config/cc_power_state_change.py +++ b/cloudinit/config/cc_power_state_change.py @@ -75,6 +75,12 @@ def load_power_state(cfg): ','.join(opt_map.keys())) delay = pstate.get("delay", "now") + # convert integer 30 or string '30' to '+30' + try: + delay = "+%s" % int(delay) + except ValueError: + pass + if delay != "now" and not re.match(r"\+[0-9]+", delay): raise TypeError("power_state[delay] must be 'now' or '+m' (minutes).") |