Fixes issues with tox
A recent change updated the settings of yapf in Spyglass. This change matches this recent change and fixes the directory used in tox. It also fixes the directories used in tox.ini and removes unnecessary flake8 ignores. Change-Id: I7036f885a3c45880b7b9be604bc6c1c533622134
This commit is contained in:
parent
ec863a4f16
commit
93e78c472d
@ -33,5 +33,6 @@ class NoSpecMatched(BaseError):
|
||||
self.specs = excel_specs
|
||||
|
||||
def display_error(self):
|
||||
print("No spec matched. Following are the available specs:\n".format(
|
||||
print(
|
||||
"No spec matched. Following are the available specs:\n".format(
|
||||
self.specs))
|
||||
|
@ -24,7 +24,8 @@ LOG_FORMAT = '%(asctime)s %(levelname)-8s %(name)s:' \
|
||||
'%(funcName)s [%(lineno)3d] %(message)s'
|
||||
|
||||
|
||||
@click.option('-v',
|
||||
@click.option(
|
||||
'-v',
|
||||
'--verbose',
|
||||
is_flag=True,
|
||||
default=False,
|
||||
@ -108,7 +109,8 @@ FORCE_OPTION = click.option(
|
||||
help="Forces manifests to be written, regardless of undefined data.")
|
||||
|
||||
|
||||
@excel.command('intermediary',
|
||||
@excel.command(
|
||||
'intermediary',
|
||||
short_help='generate intermediary',
|
||||
help='Generates an intermediary file from passed excel data.')
|
||||
@EXCEL_FILE_OPTION
|
||||
@ -124,7 +126,8 @@ def generate_intermediary(*args, **kwargs):
|
||||
process_input_ob.dump_intermediary_file(kwargs['intermediary_dir'])
|
||||
|
||||
|
||||
@excel.command('documents',
|
||||
@excel.command(
|
||||
'documents',
|
||||
short_help='generates manifest documents and intermediary',
|
||||
help='Generates manifest documents and intermediary file.')
|
||||
@click.option(
|
||||
|
@ -107,7 +107,8 @@ class ExcelPlugin(BaseDataSourcePlugin):
|
||||
host_list = []
|
||||
for rack in rackwise_hosts.keys():
|
||||
for host in rackwise_hosts[rack]:
|
||||
host_list.append({
|
||||
host_list.append(
|
||||
{
|
||||
"rack_name": rack,
|
||||
"name": host,
|
||||
"host_profile": ipmi_data[host]["host_profile"],
|
||||
@ -151,7 +152,8 @@ class ExcelPlugin(BaseDataSourcePlugin):
|
||||
tmp_vlan["name"] = "ingress"
|
||||
tmp_vlan["subnet"] = net_val
|
||||
vlan_list.append(tmp_vlan)
|
||||
LOG.debug("vlan list extracted from spyglass-plugin-xls:\n{}".format(
|
||||
LOG.debug(
|
||||
"vlan list extracted from spyglass-plugin-xls:\n{}".format(
|
||||
pprint.pformat(vlan_list)))
|
||||
return vlan_list
|
||||
|
||||
@ -194,8 +196,8 @@ class ExcelPlugin(BaseDataSourcePlugin):
|
||||
ldap_info["domain"] = url.split(".")[1]
|
||||
except IndexError as e:
|
||||
LOG.error("url.split:{}".format(e))
|
||||
ldap_info["common_name"] = ldap_raw_data.get("common_name",
|
||||
"#CHANGE_ME")
|
||||
ldap_info["common_name"] = ldap_raw_data.get(
|
||||
"common_name", "#CHANGE_ME")
|
||||
ldap_info["subdomain"] = ldap_raw_data.get("subdomain", "#CHANGE_ME")
|
||||
|
||||
return ldap_info
|
||||
@ -227,8 +229,8 @@ class ExcelPlugin(BaseDataSourcePlugin):
|
||||
location_data = self.parsed_xl_data["site_info"]["location"]
|
||||
|
||||
corridor_pattern = r"\d+"
|
||||
corridor_number = re.findall(corridor_pattern,
|
||||
location_data["corridor"])[0]
|
||||
corridor_number = re.findall(
|
||||
corridor_pattern, location_data["corridor"])[0]
|
||||
name = location_data.get("name", "#CHANGE_ME")
|
||||
state = location_data.get("state", "#CHANGE_ME")
|
||||
country = location_data.get("country", "#CHANGE_ME")
|
||||
|
@ -127,9 +127,11 @@ class ExcelParser(object):
|
||||
"type": type,
|
||||
}
|
||||
row += 1
|
||||
LOG.debug("ipmi data extracted from excel:\n{}".format(
|
||||
LOG.debug(
|
||||
"ipmi data extracted from excel:\n{}".format(
|
||||
pprint.pformat(ipmi_data)))
|
||||
LOG.debug("host data extracted from excel:\n{}".format(
|
||||
LOG.debug(
|
||||
"host data extracted from excel:\n{}".format(
|
||||
pprint.pformat(hosts)))
|
||||
return [ipmi_data, hosts]
|
||||
|
||||
@ -149,8 +151,8 @@ class ExcelParser(object):
|
||||
vlan = vlan.lower()
|
||||
vlan_data[vlan] = cell_value
|
||||
row += 1
|
||||
LOG.debug("vlan data extracted from excel:\n%s",
|
||||
pprint.pformat(vlan_data))
|
||||
LOG.debug(
|
||||
"vlan data extracted from excel:\n%s", pprint.pformat(vlan_data))
|
||||
return vlan_data
|
||||
|
||||
def get_private_network_data(self):
|
||||
@ -270,10 +272,12 @@ class ExcelParser(object):
|
||||
ntp_servers = ws.cell(row=ntp_row, column=ntp_col).value
|
||||
try:
|
||||
if dns_servers is None:
|
||||
raise RuntimeError((
|
||||
raise RuntimeError(
|
||||
(
|
||||
"No value for dns_server from:{} Sheet:'{}' ",
|
||||
"Row:{} Col:{}",
|
||||
).format(self.file_name, provided_sheetname, dns_row, dns_col))
|
||||
).format(
|
||||
self.file_name, provided_sheetname, dns_row, dns_col))
|
||||
except RuntimeError as rerror:
|
||||
LOG.critical(rerror)
|
||||
sys.exit("Tugboat exited!!")
|
||||
|
@ -6,6 +6,7 @@ hacking==1.1.0
|
||||
|
||||
# Security
|
||||
bandit==1.6.0
|
||||
safety==1.8.5
|
||||
|
||||
# Installs Spyglass for independent tests, but not in requirements.txt since Spyglass will always install this plugin
|
||||
git+https://opendev.org/airship/spyglass.git#egg=spyglass
|
||||
|
12
tox.ini
12
tox.ini
@ -24,7 +24,7 @@ basepython = python3
|
||||
deps =
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
commands =
|
||||
yapf -ir {toxinidir}/spyglass-plugin-xls {toxinidir}/setup.py
|
||||
yapf -ir {toxinidir}/spyglass_plugin_xls {toxinidir}/setup.py
|
||||
|
||||
[testenv:pep8]
|
||||
basepython = python3
|
||||
@ -32,9 +32,9 @@ deps =
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
commands =
|
||||
bash -c "{toxinidir}/tools/gate/whitespace-linter.sh"
|
||||
yapf -dr {toxinidir}/spyglass-plugin-xls {toxinidir}/setup.py
|
||||
flake8 {toxinidir}/spyglass-plugin-xls
|
||||
bandit -r spyglass-plugin-xls -n 5
|
||||
yapf -dr {toxinidir}/spyglass_plugin_xls {toxinidir}/setup.py
|
||||
flake8 {toxinidir}/spyglass_plugin_xls
|
||||
bandit -r spyglass_plugin_xls -n 5
|
||||
safety check -r requirements.txt --bare
|
||||
whitelist_externals =
|
||||
bash
|
||||
@ -49,10 +49,10 @@ commands =
|
||||
[testenv:bandit]
|
||||
deps =
|
||||
bandit
|
||||
commands = bandit -r spyglass-plugin-xls -n 5
|
||||
commands = bandit -r spyglass_plugin_xls -n 5
|
||||
|
||||
[flake8]
|
||||
ignore = E125,E251,W503
|
||||
ignore = W503
|
||||
|
||||
[testenv:docs]
|
||||
basepython = python3
|
||||
|
Loading…
Reference in New Issue
Block a user