Update the ae catalog support to properly consider <publisher>/<name>

This commit is contained in:
R. Tyler Croy 2017-01-24 23:22:21 -08:00
parent 40f5eb58ba
commit 1f1a24066c
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
2 changed files with 14 additions and 8 deletions

18
bin/ae
View File

@ -100,13 +100,19 @@ class FileCatalog:
def load(self):
path = re.split('file:\/\/', self.uri)[1]
catalog_dir = os.path.join(path, 'catalog')
if os.path.isdir(catalog_dir):
for schematic in os.listdir(catalog_dir):
if not schematic.endswith('.yaml'):
if not os.path.isdir(catalog_dir):
return
for root, dirs, files in os.walk(catalog_dir):
for f in files:
if not f.endswith('.yaml'):
continue
name = re.sub('\.yaml', '', schematic)
schematic = os.path.join(catalog_dir, schematic)
self.schematics[name] = yaml.load(file(schematic))
publisher = os.path.basename(root)
name = re.sub('\.yaml', '', f)
qualified_name = '/'.join([publisher, name])
self.schematics[qualified_name] = yaml.load(file(os.path.join(root, f)))
def has_schematic(self, schematic):
if self.schematics.has_key(schematic):

View File

@ -1,5 +1,5 @@
catalogs:
- file:///home/tyler/source/github/berriedale/schematics
schematics:
- aws
- gtkada
- adacore/aws
- adacore/gtkada