Skip to content

Commit

Permalink
Item: hitachienergy#58 Desc: Changed list creation to more pythonic way
Browse files Browse the repository at this point in the history
  • Loading branch information
erzetpe committed Mar 29, 2019
1 parent ed2ab36 commit 561b1e0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions core/src/epicli/cli/engine/AnsibleInventoryCreator.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def create(self):
save_inventory(inventory, self.cluster_model.specification.name)

def get_inventory(self):
inventory = list()
inventory = []
for component_key, component_value in self.cluster_model.specification.components.items():
if component_value.count < 1:
continue
Expand Down Expand Up @@ -56,7 +56,7 @@ def group_duplicated(inventory):
if host not in groups[item.role]:
groups[item.role].append(host)

result = list()
result = []
for key, value in groups.items():
result.append(AnsibleInventoryItem(key, value))
return result
2 changes: 1 addition & 1 deletion core/src/epicli/cli/engine/aws/AWSAPIProxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_ips_for_feature(self, feature_key, look_for_public_ip=False):
}]
)

result = list()
result = []
for instance in running_instances:
if look_for_public_ip:
result.append(AnsibleHostModel(instance.public_dns_name, instance.public_ip_address))
Expand Down
2 changes: 1 addition & 1 deletion core/src/epicli/cli/engine/aws/AWSConfigBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class AWSConfigBuilder(InfrastructureConfigBuilder):
def build(self, cluster_model, user_input):
result = list()
result = []
vpc_config = self.get_vpc_config(cluster_model, user_input)
result.append(vpc_config)
vpc_name = vpc_config.specification.name
Expand Down
2 changes: 1 addition & 1 deletion core/src/epicli/cli/helpers/list_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def select_first(documents, query):

def select_all(documents, query):
if documents is not None:
result = list()
result = []
for x in documents:
if query(x):
result.append(x)
Expand Down

0 comments on commit 561b1e0

Please sign in to comment.