summaryrefslogtreecommitdiff
path: root/cloudinit/config
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/config')
-rw-r--r--cloudinit/config/cc_power_state_change.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/cloudinit/config/cc_power_state_change.py b/cloudinit/config/cc_power_state_change.py
index 8f99e887..638daef8 100644
--- a/cloudinit/config/cc_power_state_change.py
+++ b/cloudinit/config/cc_power_state_change.py
@@ -89,8 +89,9 @@ def load_power_state(cfg):
mode = pstate.get("mode")
if mode not in opt_map:
- raise TypeError("power_state[mode] required, must be one of: %s." %
- ','.join(opt_map.keys()))
+ raise TypeError(
+ "power_state[mode] required, must be one of: %s. found: '%s'." %
+ (','.join(opt_map.keys()), mode))
delay = pstate.get("delay", "now")
# convert integer 30 or string '30' to '+30'
@@ -100,7 +101,9 @@ def load_power_state(cfg):
pass
if delay != "now" and not re.match(r"\+[0-9]+", delay):
- raise TypeError("power_state[delay] must be 'now' or '+m' (minutes).")
+ raise TypeError(
+ "power_state[delay] must be 'now' or '+m' (minutes)."
+ " found '%s'." % delay)
args = ["shutdown", opt_map[mode], delay]
if pstate.get("message"):