# See the License for the specific language governing permissions and
# limitations under the License.
+venv
+
+.tox
+
*.pyc
.cache
osm_im/nsi.py
osm_im/osm.yaml
osm_im/etsi-nfv-nsd.py
+osm_im/etsi_nfv_nsd.py
osm_im/etsi-nfv-vnfd.py
+osm_im/etsi_nfv_vnfd.py
+sol006_model
#Pyang and other tools' folders
pyangbind
# See the License for the specific language governing permissions and
# limitations under the License.
+include Makefile
recursive-include osm_im *.py *.txt
-recursive-include models *.yang
\ No newline at end of file
+recursive-include models *.yang
+recursive-include patch *.patch
\ No newline at end of file
all: models trees openapi_schemas
$(MAKE) package
-models: sol006_deps $(PYTHON_MODELS)
+models: sol006_deps $(PYTHON_MODELS) rename_etsi_nfv_py
trees: $(YANG_DESC_TREES) $(YANG_DESC_JSTREES) $(YANG_RECORD_TREES) $(YANG_RECORD_JSTREES)
osm.yaml: yang-ietf yang2swagger
$(Q)echo generating $@
- $(Q)$(JAVA) -jar ${HOME}/.m2/repository/com/mrv/yangtools/swagger-generator-cli/1.1.11/swagger-generator-cli-1.1.11-executable.jar -yang-dir $(MODEL_DIR) -output $(OUT_DIR)/$@
+ $(Q)$(JAVA) -jar ${HOME}/.m2/repository/com/mrv/yangtools/swagger-generator-cli/1.1.14/swagger-generator-cli-1.1.14-executable.jar -yang-dir $(MODEL_DIR) -output $(OUT_DIR)/$@
yang-ietf:
$(Q)wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O $(MODEL_DIR)/ietf-yang-types.yang
$(Q)mkdir -p ${HOME}/.m2
$(Q)wget -q -O ${HOME}/.m2/settings.xml https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml
git clone https://github.com/bartoszm/yang2swagger.git
- git -C yang2swagger checkout tags/1.1.11
+ git -C yang2swagger checkout tags/1.1.14
mvn -f yang2swagger/pom.xml clean install
package:
$(Q)patch -p2 < patch/deref_warnings.patch
$(Q)patch -p2 < patch/nested_workaround.patch
+rename_etsi_nfv_py:
+ mv osm_im/etsi-nfv-nsd.py osm_im/etsi_nfv_nsd.py
+ mv osm_im/etsi-nfv-vnfd.py osm_im/etsi_nfv_vnfd.py
+
clean:
$(Q)rm -rf dist sol006_model osm_im.egg-info deb deb_dist *.gz osm-imdocs* yang2swagger $(TREES_DIR)
+ $(Q)rm -rf debian/osm-imdocs.install osm_im/etsi_nfv_nsd.py osm_im/etsi_nfv_vnfd.py osm_im/nsd.py
+ $(Q)rm -rf osm_im/nsi.py osm_im/nst.py osm_im/osm.yaml osm_im/vnfd.py
from osm_im.vnfd import vnfd as vnfd_im
from osm_im.nsd import nsd as nsd_im
from osm_im.nst import nst as nst_im
-etsi_nfv_vnfd = importlib.import_module("osm_im.etsi-nfv-vnfd")
-etsi_nfv_nsd = importlib.import_module("osm_im.etsi-nfv-nsd")
+from osm_im import etsi_nfv_vnfd, etsi_nfv_nsd
from pyangbind.lib.serialise import pybindJSONDecoder
import pyangbind.lib.pybindJSON as pybindJSON
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)