Fix bug 1612 - fixing build to allow python3 -m build
Change-Id: Id2db32f81dd4f4e7b411ebc2a189f6817a26d63c
Signed-off-by: sousaedu <eduardo.sousa@canonical.com>
diff --git a/setup.py b/setup.py
index 71c7eae..ec75988 100644
--- a/setup.py
+++ b/setup.py
@@ -35,11 +35,23 @@
import pyangbind
print("Using dir {}/{} for python artifacts".format(os.getcwd(), self.im_dir))
path = "{}/{}".format(os.getcwd(), self.im_dir)
+
protoc_command = ["make", "models"]
if subprocess.call(protoc_command) != 0:
sys.exit(-1)
+
# To ensure generated files are copied to the python installation folder
- self.copy_tree(self.im_dir, "{}{}".format(self.install_lib, self.im_dir))
+ install_path = "{}{}".format(self.install_lib, self.im_dir)
+ self.copy_tree(self.im_dir, install_path)
+ if os.path.isfile("{}/etsi-nfv-nsd.py".format(install_path)):
+ self.move_file(
+ "{}/etsi-nfv-nsd.py".format(install_path), "{}/etsi_nfv_nsd.py".format(install_path)
+ )
+ if os.path.isfile("{}/etsi-nfv-vnfd.py".format(install_path)):
+ self.move_file(
+ "{}/etsi-nfv-vnfd.py".format(install_path), "{}/etsi_nfv_vnfd.py".format(install_path)
+ )
+
install.run(self)