added --standalone and --disp shortcuts

This commit is contained in:
GammaSQ 2018-12-03 09:21:01 +01:00
parent 0b47df2b54
commit e55b530865
No known key found for this signature in database
GPG Key ID: D552FD2F98647C64

View File

@ -43,6 +43,14 @@ parser.add_argument('--class', '-C', dest='cls',
default='AppVM',
help='specify the class of the new domain (default: %(default)s)')
parser.add_argument('--standalone',
action="store_true",
help=' shortcut for --class StandaloneVM')
parser.add_argument('--disp'
action=qubesadmin.tools.SinglePropertyAction,
help='alias for --class DispVM --label red --template <argument or default DVM>')
parser.add_argument('--property', '--prop',
action=qubesadmin.tools.PropertyAction,
help='set domain\'s property, like "internal", "memory" or "vcpus"')
@ -113,6 +121,14 @@ def main(args=None, app=None):
if args.one_pool:
pool = args.one_pool
if 'disp' in args.properties:
args.properties.setdefault('label', 'red')
args.cls = 'DispVM'
args.properties.setdefault('template', args.properties['disp'])
if 'standalone' in args.properties:
args.cls = 'StandaloneVM'
if 'label' not in args.properties:
parser.error('--label option is mandatory')