diff options
author | Cole Robinson <crobinso@redhat.com> | 2016-06-12 10:11:11 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2016-06-12 10:11:11 -0400 |
commit | 0663e52a62da7df2350febf6606724590b5b2a8d (patch) | |
tree | 50e4aa0cf92bc0f4bc197b654c9ceb265b3b8414 | |
parent | a8914ae1e69a4436bf5873a51d3a23c055f3ec13 (diff) | |
download | virt-manager-0663e52a62da7df2350febf6606724590b5b2a8d.tar.gz |
cli: Use OrderedDict for tracking cli values
Allows us to drop the single 'orderedopts' usage
-rw-r--r-- | virtinst/cli.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/virtinst/cli.py b/virtinst/cli.py index b9fc181a..2713c409 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -20,6 +20,7 @@ # MA 02110-1301 USA. import argparse +import collections import logging import logging.handlers import os @@ -892,10 +893,7 @@ class VirtOptionString(object): virtargmap[alias] = arg # @opts: A dictionary of the mapping {cliname: val} - # @orderedopts: A list of tuples (cliname: val), in the order - # they appeared on the CLI. - self.opts, self.orderedopts = self._parse_optstr( - virtargmap, remove_first) + self.opts = self._parse_optstr(virtargmap, remove_first) def get_opt_param(self, key, is_novalue=False): if key not in self.opts: @@ -970,7 +968,7 @@ class VirtOptionString(object): def _parse_optstr(self, virtargmap, remove_first): orderedopts = self._parse_optstr_tuples(virtargmap, remove_first) - optdict = {} + optdict = collections.OrderedDict() for cliname, val in orderedopts: if (cliname not in optdict and @@ -983,7 +981,7 @@ class VirtOptionString(object): else: optdict[cliname] = val - return optdict, orderedopts + return optdict class VirtCLIParser(object): @@ -1524,7 +1522,7 @@ class ParserBoot(VirtCLIParser): def _parse(self, opts, inst): # Build boot order boot_order = [] - for cliname, ignore in opts.orderedopts: + for cliname in opts.opts.keys(): if cliname not in inst.os.BOOT_DEVICES: continue |