VOL-1830 Fixing an error with etcd querying
Change-Id: I58af41223e59b78a6eccc64d6c02cd6f87ead479
diff --git a/VERSION b/VERSION
index 7179039..2c9b9e7 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.2.3
+0.2.4-dev
diff --git a/pyvoltha/adapters/extensions/omci/database/mib_db_ext.py b/pyvoltha/adapters/extensions/omci/database/mib_db_ext.py
index d94ab6d..7523f58 100644
--- a/pyvoltha/adapters/extensions/omci/database/mib_db_ext.py
+++ b/pyvoltha/adapters/extensions/omci/database/mib_db_ext.py
@@ -918,11 +918,19 @@
else:
# Get all attributes of a specific ME
try:
- instance_data = MibInstanceData()
- instance_path = self._get_instance_path(device_id, class_id, instance_id)
- instance_data.ParseFromString(self._kv_store[instance_path])
+ class_data = MibClassData()
+ instance_data = None
+ class_path = self._get_class_path(device_id, class_id)
+ class_data.ParseFromString(self._kv_store[class_path])
end_time = datetime.utcnow()
+ for inst in class_data.instances:
+ if inst.instance_id == instance_id:
+ instance_data = inst
+
+ if instance_data == None:
+ raise KeyError
+
if attributes is None:
# All Attributes
data = self._instance_to_dict(device_id, class_id, instance_data)
@@ -937,7 +945,7 @@
class_id,
attr.name,
attr.value)
- for attr in inst_data.attributes if attr.name in attributes}
+ for attr in instance_data.attributes if attr.name in attributes}
except KeyError:
data = dict()