From 6e9faf148f5d9ee999d38618855f06b49ded2126 Mon Sep 17 00:00:00 2001 From: garciaale Date: Tue, 3 Nov 2020 15:36:31 -0300 Subject: [PATCH] Changes setup.py to generate all OSM models Change-Id: I932490e6d3826e90ca18dee6b73215758ac9ae79 Signed-off-by: garciaale --- setup.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/setup.py b/setup.py index f59e790..dfa5cee 100644 --- a/setup.py +++ b/setup.py @@ -35,20 +35,9 @@ class Install_osm_im(install): import pyangbind print("Using dir {}/{} for python artifacts".format(os.getcwd(), self.im_dir)) path = "{}/{}".format(os.getcwd(), self.im_dir) - for files_item in ['vnfd', 'nsd', 'nst']: - protoc_command = ["pyang", - "-Werror", - "--plugindir", - "{}/plugin".format(os.path.dirname(pyangbind.__file__)), - "--path", - self.model_dir, - "-f", "pybind", - "-o", - "{}/{}.py".format(self.im_dir, files_item), - "{}/{}.yang".format(self.model_dir, files_item)] - print("Generating {}.py from {}.yang".format(files_item, files_item)) - if subprocess.call(protoc_command) != 0: - sys.exit(-1) + 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.run(self) -- 2.17.1