Fix error reporting on node name collision
Signed-off-by: martin f. krafft <madduck@madduck.net>
diff --git a/reclass/errors.py b/reclass/errors.py
index 2440178..4da2bc3 100644
--- a/reclass/errors.py
+++ b/reclass/errors.py
@@ -208,4 +208,4 @@
msg = "{0}: Definition of node '{1}' in '{2}' collides with " \
"definition in '{3}'. Nodes can only be defined once " \
"per inventory."
- return msg.format(storage, name, uris[1], uris[0])
+ return msg.format(self._storage, self._name, self._uris[1], self._uris[0])
diff --git a/reclass/storage/yaml_fs/__init__.py b/reclass/storage/yaml_fs/__init__.py
index c187afc..fafc033 100644
--- a/reclass/storage/yaml_fs/__init__.py
+++ b/reclass/storage/yaml_fs/__init__.py
@@ -60,7 +60,7 @@
uri = os.path.join(dirpath, f)
if name in ret:
E = reclass.errors.DuplicateNodeNameError
- raise E(self._get_storage_name(), name,
+ raise E(self.name, name,
os.path.join(basedir, ret[name]), uri)
ret[name] = os.path.join(relpath, f)