Skip to content

Commit 0af873e

Browse files
committed
Also remove dynamic tables again. Robustness ag/ missing attrs.
Signed-off-by: Kurt Garloff <[email protected]>
1 parent bf34da7 commit 0af873e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Tests/iaas/flavor-naming/flavor-name-check.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
# !/usr/bin/env python3
22
# vim: set ts=4 sw=4 et:
33
#
44
"""Flavor naming checker
@@ -216,7 +216,9 @@ def out(self):
216216
ostr += self.outstr[i]
217217
i += 1
218218
continue
219-
att = self.__getattribute__(self.pattrs[par])
219+
att = None
220+
if hasattr(self, self.pattrs[par]):
221+
att = self.__getattribute__(self.pattrs[par])
220222
if self.outstr[i+1] == ".":
221223
ostr += self.outstr[i:i+2]
222224
if int(att) == att:
@@ -283,11 +285,13 @@ def create_dep_tbl(self, idx, val):
283285
dtbl = f"tbl_{fname}_{val}_{self.pattrs[idx+1]}"
284286
else:
285287
return False
286-
if hasattr(self, ntbl):
287-
return True
288+
# if hasattr(self, ntbl):
289+
# return True
288290
if hasattr(self, dtbl):
289291
self.__setattr__(ntbl, self.__getattribute__(dtbl))
290292
return True
293+
elif hasattr(self, ntbl) and not hasattr(type(self), ntbl):
294+
delattr(self, ntbl)
291295
return False
292296

293297
def std_validator(self):

Tests/iaas/flavor-naming/flavor-name-describe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def prettyname(item_list, prefix=""):
7575
stg += tbl_out(gpu, "brand")
7676
stg += tbl_out(gpu, "perf", True)
7777
stg += gpu.__getattribute__(f"tbl_brand_{gpu.brand}_gen")[gpu.gen] + " "
78-
if gpu.cu:
78+
if hasattr(gpu, "cu") and gpu.cu:
7979
stg += f"(w/ {gpu.cu} CU/EU/SM) "
8080
# IB
8181
if ibd.parsed:

0 commit comments

Comments
 (0)