Skip to content
Permalink
Browse files

fix: backport badfish interface index & fc640 fix

Backport the standalone upstream badfish fixes into QUADS badfish
library and include fc640 bladecenter/hostname regex.

Change-Id: Iaba5a8a3530f627c16001f4e37021477c6651642
  • Loading branch information
sadsfae committed Mar 13, 2020
1 parent acda6ea commit ef1a4e289cde535e589f74a0fa812bcbe8b86550
Showing with 13 additions and 5 deletions.
  1. +1 −1 conf/quads.yml
  2. +12 −4 quads/tools/badfish.py
@@ -69,7 +69,7 @@ rt_url: https://engineering.example.com/rt/Ticket/Display.html
# this is used in some of the wiki generate for the links
quads_url: http://quads.scalelab.example.com
# url for a request form if you use one
# e.g. http://scalelab.redhat.com
# e.g. http://scalelab.example.com
quads_request_url:

# Foreman Specific Variables
@@ -255,7 +255,8 @@ def progress_bar(value, end_value, state, bar_length=20):

host_model = self.host.split(".")[0].split("-")[-1]
host_blade = self.host.split(".")[0].split("-")[-2]
if host_blade != "000":
b_pattern = re.compile("b0[0-9]")
if b_pattern.match(host_blade):
host_model = "%s_%s" % (host_model, host_blade)
interfaces = {}
for _host in ["foreman", "director"]:
@@ -390,13 +391,19 @@ def progress_bar(value, end_value, state, bar_length=20):

host_model = self.host.split(".")[0].split("-")[-1]
host_blade = self.host.split(".")[0].split("-")[-2]
if host_blade != "000":
b_pattern = re.compile("b0[0-9]")
if b_pattern.match(host_blade):
host_model = "%s_%s" % (host_model, host_blade)
interfaces = definitions["%s_%s_interfaces" % (_host_type, host_model)].split(",")

boot_devices = await self.get_boot_devices()
devices = [device["Name"] for device in boot_devices]
valid_devices = [device for device in interfaces if device in devices]
if len(valid_devices) < len(interfaces):
diff = [device for device in interfaces if device not in valid_devices]
logger.warning("Some interfaces are not valid boot devices. Ignoring: %s" % ", ".join(diff))
change = False
for i in range(len(interfaces)):
for i in range(len(valid_devices)):
for device in boot_devices:
if interfaces[i] == device[u"Name"]:
if device[u"Index"] != i:
@@ -791,7 +798,8 @@ def get_host_type_boot_device(self, host_type, _interfaces_path):

host_model = self.host.split(".")[0].split("-")[-1]
host_blade = self.host.split(".")[0].split("-")[-2]
if host_blade != "000":
b_pattern = re.compile("b0[0-9]")
if b_pattern.match(host_blade):
host_model = "%s_%s" % (host_model, host_blade)
return definitions["%s_%s_interfaces" % (host_type, host_model)].split(",")[0]
return None

0 comments on commit ef1a4e2

Please sign in to comment.
You can’t perform that action at this time.