diff options
-rwxr-xr-x | writeexts.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/writeexts.py b/writeexts.py index 49cd89dd..c74a4b76 100755 --- a/writeexts.py +++ b/writeexts.py @@ -273,3 +273,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) |