Skip to content

Commit

Permalink
Fix a use-before-set in the mgr codepath
Browse files Browse the repository at this point in the history
  • Loading branch information
cvaroqui committed Oct 4, 2019
1 parent 7971c70 commit fa14def
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/mgr.py
Expand Up @@ -212,15 +212,17 @@ def dispatch(self, argv):
elif action == "ls":
mod = __import__("svcmgr_parser")
parser = getattr(mod, "SvcmgrOptParser")()
expanded_svcs = None
yield parser
else:
expanded_svcs = self.node.svcs_selector(selector, namespace)
self.expanded_svcs = expanded_svcs
svc_by_kind = self.dispatch_svcs(expanded_svcs)
for kind, paths in svc_by_kind.items():
mod = __import__(kind+"mgr_parser")
parser = getattr(mod, kind.capitalize()+"mgrOptParser")()
yield parser
if expanded_svcs is not None:
svc_by_kind = self.dispatch_svcs(expanded_svcs)
for kind, paths in svc_by_kind.items():
mod = __import__(kind+"mgr_parser")
parser = getattr(mod, kind.capitalize()+"mgrOptParser")()
yield parser

def parse_args(self, argv):
if self.parser:
Expand Down

0 comments on commit fa14def

Please sign in to comment.