Fix. Replace pkg_resources by importlib.metadata in osm_nbi init file
Change-Id: I5316d242a0e720a54475cf5ab739a8e8541dab6d
Signed-off-by: caviedesj <juancamilo.caviedesvalencia.ext@telefonica.com>
diff --git a/osm_nbi/__init__.py b/osm_nbi/__init__.py
index 3bfe160..ccb63c7 100644
--- a/osm_nbi/__init__.py
+++ b/osm_nbi/__init__.py
@@ -15,10 +15,10 @@
version = "7.0.1.post23"
version_date = "2020-04-17"
-# Obtain installed package version. Ignore if error, e.g. pkg_resources not installed
+# Obtain installed package version. Ignore if error, e.g. import importlib.metadata not installed
try:
- from pkg_resources import get_distribution
+ import importlib.metadata
- version = get_distribution("osm_nbi").version
+ version = importlib.metadata.version("osm_nbi")
except Exception:
pass