diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2013-05-13 10:00:20 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2013-05-13 10:00:20 +0000 |
commit | 4c2622fb9cd40f2e8c3f6d3ef4ca6e1ed1e3a489 (patch) | |
tree | 10934d0872c931aed13405ca713bce910077943c /writeexts.py | |
parent | 0dd6bf15bfb6fba31c2ce238ce352d2185ac1ba8 (diff) | |
parent | 2287b2a81ca8a19e41cc9edf3cb8c2c361bfa4e4 (diff) | |
download | definitions-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.
Diffstat (limited to 'writeexts.py')
-rwxr-xr-x | writeexts.py | 12 |
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) |