summaryrefslogtreecommitdiff
path: root/morphlib/writeexts.py
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
commit3cb8c3a4c1c6853f51a3c5cad411673d42d8f6b8 (patch)
tree1c40cc932c088ec2c45236d84064518929c042e6 /morphlib/writeexts.py
parent9898c112dfced5bd5fe3a56aab64a7a0163ebe16 (diff)
parent1b2f2013bb85769352e82cfd55a3179fe16ccce2 (diff)
downloadmorph-3cb8c3a4c1c6853f51a3c5cad411673d42d8f6b8.tar.gz
Merge branch 'baserock/richardmaw/kvm-write-allow-autostart' of git://git.baserock.org/baserock/baserock/morph
Reviewed-by: Jonathan Maw on IRC.
Diffstat (limited to 'morphlib/writeexts.py')
-rwxr-xr-xmorphlib/writeexts.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/morphlib/writeexts.py b/morphlib/writeexts.py
index 48847d56..aea08085 100755
--- a/morphlib/writeexts.py
+++ b/morphlib/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)