From c8363cfc95133389a9aad2144f5b5c39736476fa Mon Sep 17 00:00:00 2001 From: Bahtiar `kalkin-` Gadimov Date: Wed, 25 May 2016 16:59:31 +0200 Subject: [PATCH] qvm-pool simplify options parsing --- qubes/tools/qvm_pool.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/qubes/tools/qvm_pool.py b/qubes/tools/qvm_pool.py index 8e5b6df9..da114147 100644 --- a/qubes/tools/qvm_pool.py +++ b/qubes/tools/qvm_pool.py @@ -136,14 +136,8 @@ class _Options(argparse.Action): help='comma-separated list of driver options') def __call__(self, parser, namespace, options, option_string=None): - result = {} - for option in options.split(','): - if option.count('=') != 1: - parser.error('option %s should have form option=value' % - option) - name, value = option.split('=') - result[name] = value - setattr(namespace, 'options', result) + setattr(namespace, 'options', + dict([option.split('=', 1) for option in options.split(',')])) def get_parser():