Skip to content

Commit a2ea7d6

Browse files
pleasing linter
1 parent 02d32c2 commit a2ea7d6

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

bibigrid/core/actions/create.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,11 @@ def upload_data(self, private_key, clean_playbook=False):
432432
"""
433433
self.log.debug("Running upload_data")
434434

435-
self.write_remote = self.write_remote + ansible_configurator.configure_ansible_yaml(providers=self.providers,
436-
configurations=self.configurations,
437-
cluster_id=self.cluster_id,
438-
log=self.log)
435+
self.write_remote = (self.write_remote +
436+
ansible_configurator.configure_ansible_yaml(providers=self.providers,
437+
configurations=self.configurations,
438+
cluster_id=self.cluster_id,
439+
log=self.log))
439440
self.write_remote.append((self.host_vars, a_rp.HOSTS_FILE_REMOTE))
440441
ansible_start = ssh_handler.ansible_start(",".join(self.permanents))
441442
self.log.debug(f"Starting playbook with {ansible_start}.")

bibigrid/core/utility/ansible_commands.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
Module containing a bunch of useful commands to be used by sshHandler.py for cluster setup
33
"""
44

5-
import os
6-
import bibigrid.core.utility.paths.ansible_resources_path as a_rp
7-
85
# TO_LOG = "| sudo tee -a /var/log/ansible.log"
96
# AIY = "apt-get -y install"
107
# SAU = "sudo apt-get update"
@@ -56,9 +53,9 @@
5653
"Waiting for service {service}.")
5754
UPDATE = ("sudo apt-get update", "Update apt repository lists.")
5855
PYTHON3_PIP = ("sudo apt-get install -y python3-pip python3-venv", "Install python3 pip and venv using apt.")
59-
VENV_SETUP = ("sudo python3 -m venv /opt/bibigrid-venv"," Create bibigrid virtual environment.")
56+
VENV_SETUP = ("sudo python3 -m venv /opt/bibigrid-venv", " Create bibigrid virtual environment.")
6057
ANSIBLE_PASSLIB = ("sudo /opt/bibigrid-venv/bin/pip install ansible==10.7 passlib",
6158
"Install Ansible 10.7 and Passlib using pip.")
62-
ANSIBLE_GALAXY = ("sudo /opt/bibigrid-venv/bin/ansible-galaxy collection install "+
59+
ANSIBLE_GALAXY = ("sudo /opt/bibigrid-venv/bin/ansible-galaxy collection install " +
6360
"-p /usr/share/ansible/collections community.zabbix==3.2.0",
6461
"Install necessary ansible-galaxy modules.")

bibigrid/core/utility/ansible_configurator.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def get_vpn_var(*, provider, configuration, cluster_id, vpngtw, vpn_count):
138138
return vpngtw_dict, os.path.join(aRP.HOST_VARS_FOLDER_REMOTE, f"{name}.yaml")
139139

140140

141-
def get_master_var(provider, configuration, cluster_id, log):
141+
def get_master_var(provider, configuration, cluster_id):
142142
master = configuration["masterInstance"]
143143
name = MASTER_IDENTIFIER(cluster_id=cluster_id)
144144
flavor_dict = provider.create_flavor_dict(flavor=master["type"])
@@ -184,7 +184,7 @@ def get_host_and_group_vars(configurations, providers, cluster_id, log):
184184
get_vpn_var(provider=provider, configuration=configuration, cluster_id=cluster_id, vpngtw=vpngtw,
185185
vpn_count=vpn_count))
186186
else:
187-
write_remote.append(get_master_var(provider, configuration, cluster_id, log))
187+
write_remote.append(get_master_var(provider, configuration, cluster_id))
188188
return write_remote
189189

190190

@@ -408,7 +408,6 @@ def configure_ansible_yaml(providers, configurations, cluster_id, log):
408408
@return:
409409
"""
410410
log.info("Writing ansible files...")
411-
alias = configurations[0].get("aliasDumper", False)
412411
user_roles = configurations[0].get("userRoles", [])
413412
default_user = providers[0].cloud_specification["auth"].get("username", configurations[0].get("sshUser", "Ubuntu"))
414413
add_wireguard_peers(configurations)

0 commit comments

Comments
 (0)