1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 20:11:20 +00:00

Fix: correctly handle non-identifier alias names

Update ExtensionLoader to index aliases by their identifier'd name.
This commit is contained in:
Sergei Trofimov 2015-04-27 11:57:34 +01:00
parent f906cbd851
commit 101d6a37ce

View File

@ -374,9 +374,10 @@ class ExtensionLoader(object):
store = self._get_store(ext)
store[key] = obj
for alias in obj.aliases:
if alias in self.extensions or alias in self.aliases:
alias_id = identifier(alias.name)
if alias_id in self.extensions or alias_id in self.aliases:
raise LoaderError('{} {} already exists.'.format(ext.name, obj.name))
self.aliases[alias.name] = alias
self.aliases[alias_id] = alias
# Update global aliases list. If a global alias is already in the list,
# then make sure this extension is in the same parent/child hierarchy