IPAOptionParser: fix dict comprehension

The statement can be simplified and be more resources friendly

Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
This commit is contained in:
Martin Basti 2017-07-10 14:54:10 +02:00 committed by Tomas Krizek
parent 7f8d79f637
commit f18ce01355
No known key found for this signature in database
GPG Key ID: 22A2A94B5E49415A

View File

@ -114,7 +114,10 @@ class IPAOptionParser(OptionParser):
Returns all options except those with sensitive=True in the same
fashion as parse_args would
"""
all_opts_dict = dict([ (o.dest, o) for o in self._get_all_options() if hasattr(o, 'sensitive') ])
all_opts_dict = {
o.dest: o for o in self._get_all_options()
if hasattr(o, 'sensitive')
}
safe_opts_dict = {}
for option, value in opts.__dict__.items():