Skip to content

Commit b2f118b

Browse files
chore: remove special casing of 'latest' string when loading schemas
1 parent 84ccfe8 commit b2f118b

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

juju/client/facade.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -954,18 +954,13 @@ def generate_facades(schemas: Dict[str, List[Schema]]) -> Dict[str, Dict[int, co
954954

955955
def load_schemas(options):
956956
schemas = {}
957-
958957
for p in sorted(glob(options.schema)):
959-
if 'latest' in p:
960-
juju_version = 'latest'
961-
else:
962-
try:
963-
juju_version = re.search(JUJU_VERSION, p).group()
964-
except AttributeError:
965-
print("Cannot extract a juju version from {}".format(p))
966-
print("Schemas must include a juju version in the filename")
967-
raise SystemExit(1)
968-
958+
try:
959+
juju_version = re.search(JUJU_VERSION, p).group()
960+
except AttributeError:
961+
print("Cannot extract a juju version from {}".format(p))
962+
print("Schemas must include a juju version in the filename")
963+
raise SystemExit(1)
969964
new_schemas = json.loads(Path(p).read_text("utf-8"))
970965
schemas[juju_version] = [Schema(s) for s in new_schemas]
971966
return schemas

0 commit comments

Comments
 (0)