fixed bug in DellConfiguratorParser2025 : chassis is no longer hardcoded
work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=4171]
This commit is contained in:
parent
34552b83b5
commit
3cd99587ca
|
|
@ -987,7 +987,19 @@ class DellConfiguratorParser2025(DellConfiguratorParser):
|
|||
super().__init__(use_additional_cpus_module=False) # no information is available in additional_cpus module. use cpu_change module instead
|
||||
|
||||
def _parse_chassis(self, html_root: HtmlElement) -> str:
|
||||
chassis_id = "dell-poweredge-r670"
|
||||
# <div class="col cf-hero-details">
|
||||
# <div class="cf-product-order">
|
||||
# <h1 class="cf-pg-title"><span>Cat2 Conf 2-2-07: Dell Poweredge R670</span></h1>
|
||||
conf_title_element = html_root.xpath(".//h1[@class='cf-pg-title']")[0]
|
||||
assert conf_title_element is not None
|
||||
title_span_element = conf_title_element.xpath(".//span")[0]
|
||||
assert title_span_element is not None
|
||||
title = title_span_element.text_content().replace('\n', '').strip() # eg 'Cat2 Conf 2-2-07: Dell Poweredge R670'
|
||||
match = re.match(r'^Cat[0-9]+ Conf [0-9\-]+: Dell Poweredge (?P<chassis_type>[CR][0-9][0-9][0-9][0-9]?).*', title)
|
||||
assert match, 'unhandled title : %s' % title
|
||||
# print(match['cpu_class'], match['cpu_number'])
|
||||
chassis_id = "dell-poweredge-%s" % (match['chassis_type'].lower(), ) # eg "dell-poweredge-r670"
|
||||
logging.debug(f'chassis_id : {chassis_id}')
|
||||
return chassis_id
|
||||
|
||||
def get_module_label(self, module_id) -> str:
|
||||
|
|
|
|||
Loading…
Reference in New Issue