qvm-pool simplify options parsing

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-05-25 16:59:31 +02:00
parent 27305dd85d
commit c8363cfc95
No known key found for this signature in database
GPG Key ID: 96ED3C3BA19C3DEE

View File

@ -136,14 +136,8 @@ class _Options(argparse.Action):
help='comma-separated list of driver options') help='comma-separated list of driver options')
def __call__(self, parser, namespace, options, option_string=None): def __call__(self, parser, namespace, options, option_string=None):
result = {} setattr(namespace, 'options',
for option in options.split(','): dict([option.split('=', 1) 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)
def get_parser(): def get_parser():