summaryrefslogtreecommitdiff
path: root/morphlib/writeexts.py
diff options
context:
space:
mode:
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 2cdba86f..9caab839 100755
--- a/morphlib/writeexts.py
+++ b/morphlib/writeexts.py
@@ -228,3 +228,15 @@ class WriteExtension(cliapp.Application):
return s.split(':')
else:
return []
+
+ 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)