diff options
Diffstat (limited to 'morphlib/writeexts.py')
-rwxr-xr-x | morphlib/writeexts.py | 12 |
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) |