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 authored and Tomas Krizek committed 2017-07-14 09:15:00 +02:00
1 parent 7f8d79f637
commit f18ce01355
1 file changed
+4 -1
+4 -1
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():