Minor fixes to additional metric labels
[osm/MON.git] / osm_mon / collector / vnf_collectors / juju.py
index 8be9e28..a73f1bb 100644 (file)
@@ -51,7 +51,10 @@ class VCACollector(BaseCollector):
         # Populate extra tags for metrics
         tags = {}
         tags['ns_name'] = self.common_db.get_nsr(nsr_id)['name']
-        tags['project_id'] = vnfr['_admin']['projects_read'][0]
+        if vnfr['_admin']['projects_read']:
+            tags['project_id'] = vnfr['_admin']['projects_read'][0]
+        else:
+            tags['project_id'] = None
 
         metrics = []
         for vdur in vnfr['vdur']: