Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
use literal dictionary for performance speedup. code review comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
chambridge committed Jul 17, 2017
1 parent bf72698 commit 3dd99fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rho/scancommand.py
Expand Up @@ -49,7 +49,7 @@ def _create_ping_inventory(vault, vault_pass, profile_ranges, profile_port,
success_map = defaultdict(list)
best_map = defaultdict(list)
mapped_hosts = set()
hosts_dict = dict()
hosts_dict = {}

for profile_range in profile_ranges:
# pylint: disable=anomalous-backslash-in-string
Expand All @@ -62,7 +62,7 @@ def _create_ping_inventory(vault, vault_pass, profile_ranges, profile_port,
else:
hosts_dict[hostname] = None

vars_dict = dict()
vars_dict = {}
for cred_item in profile_auth_list:
cred_pass = cred_item.get('password')
cred_sshkey = cred_item.get('ssh_key_file')
Expand Down Expand Up @@ -156,10 +156,10 @@ def _create_hosts_auths_file(success_map, profile):
# pylint: disable=too-many-locals
def _create_main_inventory(vault, success_hosts, success_port_map, best_map,
profile):
yml_dict = dict()
yml_dict = {}

# Create section of successfully connected hosts
alpha_hosts = dict()
alpha_hosts = {}
for host in success_hosts:
ascii_host = str_to_ascii(host)
ascii_port = str_to_ascii(str(success_port_map[host]))
Expand Down

0 comments on commit 3dd99fa

Please sign in to comment.