Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ezh committed Dec 17, 2019
1 parent d801260 commit 1f022fb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
6 changes: 2 additions & 4 deletions cloudselect/discovery/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ def __init__(self):

def run(self):
"""Collect AWS instances."""
pathfinder = Container.pathfinder()

instances = list(self.instances())
return [pathfinder.run(i, instances) for i in instances]
self.logger.debug("Discover AWS instances")
return list(self.instances())

def instances(self):
"""Collect AWS instances."""
Expand Down
7 changes: 2 additions & 5 deletions cloudselect/discovery/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ def __init__(self):

def run(self):
"""Collect instances from shell output."""
pathfinder = Container.pathfinder()

logging.debug("Discover local instances")
instances = list(self.instances())
return [pathfinder.run(i, instances) for i in instances]
self.logger.debug("Discover local instances")
return list(self.instances())

def instances(self):
"""Collect instances from shell output."""
Expand Down
2 changes: 1 addition & 1 deletion cloudselect/group/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def run(self, name, metadata):
"Match pattern {} and value {}".format(pattern, value),
)
result = group.get(name)
if result:
if result is not None:
return result
else:
self.logger.warning(
Expand Down
2 changes: 2 additions & 0 deletions cloudselect/selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def profile_list(self):
def profile_process(self):
"""Run selection process for the specific profile."""
discovery = Container.discovery()
pathfinder = Container.pathfinder()
profile_name = Container.args().profile
report = Container.report()

Expand All @@ -125,6 +126,7 @@ def profile_process(self):
if not instances:
sys.exit("Error: No instances found")
selected = self.fzf_select(instances)
selected = [pathfinder.run(i, instances) for i in selected]
return report.run(selected)

def select(self):
Expand Down

0 comments on commit 1f022fb

Please sign in to comment.