Skip to content

Commit 002a284

Browse files
docs: add a comment explaining why check if not name and skip
It's because of an unhandled case in codegen with client-only schemas on older juju versions (e.g. 3.1.0)
1 parent d61341a commit 002a284

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

juju/client/facade.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,10 @@ def buildTypes(schema, capture):
351351
key=lambda x: str(x)):
352352
name = schema.types[kind]
353353
if not name:
354+
# when running on juju 3.1.0 client-only schemas, we get a seemingly empty entry with no name
355+
# this breaks codegen when generating a class with no name so we explicitly skip it here
356+
# note that this is not a problem with the original 3.1.0 full schema (client + others)
357+
# nor is it a problem with client-only schemas for latter juju versions (e.g. 3.3.0)
354358
continue
355359
if name in capture and name not in NAUGHTY_CLASSES:
356360
continue

0 commit comments

Comments
 (0)