Skip to content

Commit

Permalink
Also remove dynamic tables again. Robustness ag/ missing attrs.
Browse files Browse the repository at this point in the history
Signed-off-by: Kurt Garloff <[email protected]>
  • Loading branch information
garloff committed Dec 8, 2023
1 parent bf34da7 commit 0af873e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions Tests/iaas/flavor-naming/flavor-name-check.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
# !/usr/bin/env python3
# vim: set ts=4 sw=4 et:
#
"""Flavor naming checker
Expand Down Expand Up @@ -216,7 +216,9 @@ def out(self):
ostr += self.outstr[i]
i += 1
continue
att = self.__getattribute__(self.pattrs[par])
att = None
if hasattr(self, self.pattrs[par]):
att = self.__getattribute__(self.pattrs[par])
if self.outstr[i+1] == ".":
ostr += self.outstr[i:i+2]
if int(att) == att:
Expand Down Expand Up @@ -283,11 +285,13 @@ def create_dep_tbl(self, idx, val):
dtbl = f"tbl_{fname}_{val}_{self.pattrs[idx+1]}"
else:
return False
if hasattr(self, ntbl):
return True
# if hasattr(self, ntbl):
# return True
if hasattr(self, dtbl):
self.__setattr__(ntbl, self.__getattribute__(dtbl))
return True
elif hasattr(self, ntbl) and not hasattr(type(self), ntbl):
delattr(self, ntbl)
return False

def std_validator(self):
Expand Down
2 changes: 1 addition & 1 deletion Tests/iaas/flavor-naming/flavor-name-describe.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def prettyname(item_list, prefix=""):
stg += tbl_out(gpu, "brand")
stg += tbl_out(gpu, "perf", True)
stg += gpu.__getattribute__(f"tbl_brand_{gpu.brand}_gen")[gpu.gen] + " "
if gpu.cu:
if hasattr(gpu, "cu") and gpu.cu:
stg += f"(w/ {gpu.cu} CU/EU/SM) "
# IB
if ibd.parsed:
Expand Down

0 comments on commit 0af873e

Please sign in to comment.