Updates sol006 branch with master 86/9886/2
authorgarciaale <agarcia@whitestack.com>
Mon, 19 Oct 2020 18:47:00 +0000 (15:47 -0300)
committergarciaale <agarcia@whitestack.com>
Tue, 20 Oct 2020 21:39:45 +0000 (18:39 -0300)
Change-Id: I0fc5d6f0dcf1b0827430602847f0f9e627a599e2
Signed-off-by: garciaale <agarcia@whitestack.com>
1  2 
Makefile
tox.ini

diff --combined Makefile
+++ b/Makefile
@@@ -31,24 -31,17 +31,24 @@@ YANG_RECORD_TREES := $(addsuffix .rec.t
  YANG_RECORD_JSTREES := $(addsuffix .rec.html, $(YANG_RECORD_MODELS))
  OPENAPI_SCHEMAS := osm.yaml
  
 +SOL006_YANG_DESC_MODELS := etsi-nfv-vnfd etsi-nfv-nsd
 +SOL006_PYTHON_MODELS := $(addsuffix .py, $(SOL006_YANG_DESC_MODELS))
 +SOL006_YANG_DESC_TREES := $(addsuffix .tree.txt, $(SOL006_YANG_DESC_MODELS))
 +SOL006_YANG_DESC_JSTREES := $(addsuffix .html, $(SOL006_YANG_DESC_MODELS))
 +
  OUT_DIR := osm_im
  TREES_DIR := osm_im_trees
  MODEL_DIR := models/yang
 +SOL006_MODEL_DIR := sol006_model/src/yang
 +
  Q?=@
  
  PYANG_OPTIONS := -Werror
  
 -all: $(PYTHON_MODELS) trees openapi_schemas
 +all: sol006_deps $(PYTHON_MODELS) $(SOL006_PYTHON_MODELS) trees openapi_schemas
        $(MAKE) package
  
 -trees: $(YANG_DESC_TREES) $(YANG_DESC_JSTREES) $(YANG_RECORD_TREES) $(YANG_RECORD_JSTREES)
 +trees: $(YANG_DESC_TREES) $(YANG_DESC_JSTREES) $(SOL006_YANG_DESC_TREES) $(SOL006_YANG_DESC_JSTREES)
  
  openapi_schemas: $(OPENAPI_SCHEMAS)
  
@@@ -57,18 -50,15 +57,18 @@@ $(TREES_DIR)
  
  %.py: yang-ietf
        $(Q)echo generating $@ from $*.yang
 -      $(Q)pyang $(PYANG_OPTIONS) --path $(MODEL_DIR) --plugindir $(PYBINDPLUGIN) -f pybind -o $(OUT_DIR)/$@ $(MODEL_DIR)/$*.yang
 -
 +      $(if $(findstring etsi,$@), $(eval DIR=$(SOL006_MODEL_DIR)),$(eval DIR = $(MODEL_DIR)))
 +      $(Q)pyang $(PYANG_OPTIONS) --path $(DIR) --plugindir $(PYBINDPLUGIN) -f pybind -o $(OUT_DIR)/$@ $(DIR)/$*.yang
 +              
  %.tree.txt: $(TREES_DIR) yang-ietf
        $(Q)echo generating $@ from $*.yang
 -      $(Q)pyang $(PYANG_OPTIONS) --path $(MODEL_DIR) -f tree -o $(TREES_DIR)/$@ $(MODEL_DIR)/$*.yang
 +      $(if $(findstring etsi,$@), $(eval DIR=$(SOL006_MODEL_DIR)),$(eval DIR = $(MODEL_DIR)))
 +      $(Q)pyang $(PYANG_OPTIONS) --path $(DIR) -f tree -o $(TREES_DIR)/$@ $(DIR)/$*.yang
  
  %.html: $(TREES_DIR) yang-ietf
        $(Q)echo generating $@ from $*.yang
 -      $(Q)pyang $(PYANG_OPTIONS) --path $(MODEL_DIR) -f jstree -o $(TREES_DIR)/$@ $(MODEL_DIR)/$*.yang
 +      $(if $(findstring etsi,$@), $(eval DIR=$(SOL006_MODEL_DIR)),$(eval DIR = $(MODEL_DIR)))
 +      $(Q)pyang $(PYANG_OPTIONS) --path $(DIR) -f jstree -o $(TREES_DIR)/$@ $(DIR)/$*.yang
        $(Q)sed -r -i 's|data\:image/gif\;base64,R0lGODlhS.*RCAA7|https://osm.etsi.org/images/OSM-logo.png\" width=\"175\" height=\"60|g' $(TREES_DIR)/$@
        $(Q)sed -r -i 's|<a href=\"http://www.tail-f.com">|<a href="http://osm.etsi.org">|g' $(TREES_DIR)/$@
  
@@@ -89,10 -79,8 +89,10 @@@ osm.yaml: yang-ietf yang2swagge
        $(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)/$@
  
  yang-ietf:
 -      $(Q)wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O models/yang/ietf-yang-types.yang
 -      $(Q)wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types%402013-07-15.yang -O models/yang/ietf-inet-types.yang
 +      $(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)wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-inet-types%402013-07-15.yang -O $(MODEL_DIR)/ietf-inet-types.yang
 +      $(Q)cp $(MODEL_DIR)/ietf-yang-types.yang $(SOL006_MODEL_DIR)/ietf-yang-types.yang
 +      $(Q)cp $(MODEL_DIR)/ietf-inet-types.yang $(SOL006_MODEL_DIR)/ietf-inet-types.yang
  
  yang2swagger:
        $(Q)mkdir -p ${HOME}/.m2
  
  package:
        tox -e build
-       tox -e build3
        ./build-docs.sh
  
  deps:
        $(Q)sudo -H python3 -m pip install -U pyang pyangbind stdeb
        $(Q)sudo -H python2 -m pip install -U pyang pyangbind stdeb
        $(Q)mkdir -p ~/.m2
-       $(Q)cp -n ~/.m2/settings.xml{,.orig} ; wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml
+       $(Q)cp -n ~/.m2/settings.xml ~/.m2/settings.xml.orig ; wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml
  
 +sol006_deps:
 +      $(Q)git clone --single-branch --branch v2.6.1 https://forge.etsi.org/rep/nfv/SOL006.git sol006_model
 +      $(Q)patch -p2 < patch/deref_warnings.patch
 +      $(Q)patch -p2 < patch/nested_workaround.patch
 +
  clean:
 -      $(Q)rm -rf dist osm_im.egg-info deb deb_dist *.gz osm-imdocs* yang2swagger $(TREES_DIR)
 +      $(Q)rm -rf dist sol006_model osm_im.egg-info deb deb_dist *.gz osm-imdocs* yang2swagger $(TREES_DIR)
diff --combined tox.ini
+++ b/tox.ini
@@@ -1,18 -1,21 +1,18 @@@
 -# Copyright 2019 ETSI OSM
 +# Licensed under the Apache License, Version 2.0 (the "License");
 +# you may not use this file except in compliance with the License.
 +# You may obtain a copy of the License at
  #
 -# All Rights Reserved.
 -#
 -#    Licensed under the Apache License, Version 2.0 (the "License"); you may
 -#    not use this file except in compliance with the License. You may obtain
 -#    a copy of the License at
 -#
 -#         http://www.apache.org/licenses/LICENSE-2.0
 -#
 -#    Unless required by applicable law or agreed to in writing, software
 -#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 -#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 -#    License for the specific language governing permissions and limitations
 -#    under the License.
 +#    http://www.apache.org/licenses/LICENSE-2.0
  #
 +# Unless required by applicable law or agreed to in writing, software
 +# distributed under the License is distributed on an "AS IS" BASIS,
 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 +# implied.
 +# See the License for the specific language governing permissions and
 +# limitations under the License.
 +
  [tox]
- envlist = py27,py3
+ envlist = py3
  toxworkdir={homedir}/.tox
  
  [testenv]
@@@ -22,20 -25,14 +22,21 @@@ deps=nos
  commands=nosetests
  
  [testenv:flake8]
- basepython = python
+ basepython = python3
  deps = flake8
  commands =
      flake8 setup.py
  
  [testenv:build]
 +basepython = python
 +deps = stdeb
 +       setuptools-version-command
 +       setuptools == 44.0.0
 +commands = python setup.py --command-packages=stdeb.command bdist_deb
 +
 +[testenv:build3]
  basepython = python3
  deps = stdeb
         setuptools-version-command
  commands = python3 setup.py --command-packages=stdeb.command bdist_deb