qubes/tools/qubes-create: add --property option

This commit is contained in:
Wojtek Porczyk 2015-07-02 14:56:36 +02:00
parent 84eb082ed2
commit 136b3b36b8
2 changed files with 9 additions and 4 deletions

View File

@ -1115,9 +1115,7 @@ class Qubes(PropertyHolder):
doc='Which kernel to use when not overriden in VM')
def __init__(self, store=None, load=True):
super(Qubes, self).__init__(xml=None)
def __init__(self, store=None, load=True, **kwargs):
#: logger instance for logging global messages
self.log = logging.getLogger('app')
@ -1141,6 +1139,8 @@ class Qubes(PropertyHolder):
qubes.config.system_path['qubes_base_dir'],
qubes.config.system_path['qubes_store_filename'])
super(Qubes, self).__init__(xml=None, **kwargs)
if load:
self.load()

View File

@ -32,6 +32,11 @@ import qubes.tools
parser = qubes.tools.get_parser_base(description='Create new Qubes OS store.')
parser.add_argument('--property', '--prop', '-p',
action=qubes.tools.PropertyAction,
help='set global property')
def main(args=None):
'''Main routine of :program:`qubes-create`.
@ -41,7 +46,7 @@ def main(args=None):
args = parser.parse_args(args)
qubes.tools.set_verbosity(parser, args)
app = qubes.Qubes.create_empty_store(args.xml)
app = qubes.Qubes.create_empty_store(args.xml, **args.properties)
return True