summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2013-05-13 10:00:20 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2013-05-13 10:00:20 +0000
commit4c2622fb9cd40f2e8c3f6d3ef4ca6e1ed1e3a489 (patch)
tree10934d0872c931aed13405ca713bce910077943c
parent0dd6bf15bfb6fba31c2ce238ce352d2185ac1ba8 (diff)
parent2287b2a81ca8a19e41cc9edf3cb8c2c361bfa4e4 (diff)
downloaddefinitions-4c2622fb9cd40f2e8c3f6d3ef4ca6e1ed1e3a489.tar.gz
Merge branch 'baserock/richardmaw/kvm-write-allow-autostart' of git://git.baserock.org/baserock/baserock/morph
Reviewed-by: Jonathan Maw on IRC.
-rwxr-xr-xwriteexts.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/writeexts.py b/writeexts.py
index 48847d56..aea08085 100755
--- a/writeexts.py
+++ b/writeexts.py
@@ -251,3 +251,15 @@ class WriteExtension(cliapp.Application):
value = 'no'
return value == 'yes'
+
+ def parse_autostart(self):
+ '''Parse $AUTOSTART to determine if VMs should be started.'''
+
+ autostart = os.environ.get('AUTOSTART', 'no')
+ if autostart == 'no':
+ return False
+ elif autostart == 'yes':
+ return True
+ else:
+ raise cliapp.AppException('Unexpected value for AUTOSTART: %s' %
+ autostart)