Skip to content

Commit

Permalink
Merge pull request #20 from networktocode/develop
Browse files Browse the repository at this point in the history
Release 0.2.0
  • Loading branch information
dbarrosop authored Jul 27, 2019
2 parents c63747f + 2334c62 commit 8d8f607
Show file tree
Hide file tree
Showing 112 changed files with 6,871 additions and 601 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "ntc_rosetta/yang/openconfig"]
path = ntc_rosetta/yang/openconfig
url = https://github.com/openconfig/public.git
22 changes: 14 additions & 8 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
---
build:
image: latest
version: 2

python:
version: 3.6
pip_install: true
extra_requirements:
- docs
sphinx:
configuration: docs/conf.py

formats:
- htmlzip
- epub
- pdf

formats: []
python:
version: 3.7
install:
- requirements: docs/requirements.txt
- method: pip
path: .
19 changes: 19 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
CHANGELOG
=========

0.2.0
-----

- Add management interface (fxp) as an ethernet interface #2
- Adding et, ae, and irb interfaces to junos #6
- Junos allow named vlan #8
- added support for ntc-yang-models #9
- expose paths so they can be consumed from the outside #12
- Use fork of openconfig models #13
- copy vendored files #15
- Add yangson tutorial and junos config snippet #17
- load datamodels once and only once and only when/if needed #19

Thanks to:

- @benmcbenben
- @dbarrosop
- @dgjustice

0.1.0
-----

Expand Down
30 changes: 27 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ endif

DOCKER=docker run -p 8888:8888 -v ${PWD}:/ntc_rosetta ntc_rosetta-${PYTHON}:latest

YANG_VENDORED_BASE_PATH=ntc_rosetta/yang

OPENCONFIG_REPO=https://github.com/networktocode/openconfig.git
OPENCONFIG_BRANCH=7edf3c8
OPENCONFIG_FOLDER=openconfig

NTC_YANG_REPO=https://github.com/networktocode/ntc-yang-models.git
NTC_YANG_BRANCH=3afc611
NTC_YANG_FOLDER=ntc-yang-models

.PHONY: build_test_container
build_test_container:
docker build \
Expand Down Expand Up @@ -78,9 +88,23 @@ tests: build_test_containers black sphinx-test pylama mypy nbval lint
.PHONY: lint
lint:
${DOCKER} \
poetry run ntc_rosetta lint -i W001 ntc_rosetta/parsers ntc_rosetta/translators
poetry run ntc_rosetta lint -i W001 -m openconfig ntc_rosetta/parsers/openconfig ntc_rosetta/translators/openconfig
${DOCKER} \
poetry run ntc_rosetta lint -i W001 -m ntc ntc_rosetta/parsers/ntc ntc_rosetta/translators/ntc

.PHONY: publish
publish:
@${DOCKER} \
poetry publish --build --username=$PYPI_USER --password=$PYPI_PASSWORD
${DOCKER} \
poetry publish --build --username=$(PYPI_USER) --password="$(PYPI_PASSWORD)"

.PHONY: vendor
vendor:
rm -rf $(YANG_VENDORED_BASE_PATH)/$(OPENCONFIG_FOLDER)
git clone $(OPENCONFIG_REPO) $(YANG_VENDORED_BASE_PATH)/$(OPENCONFIG_FOLDER)
cd $(YANG_VENDORED_BASE_PATH)/$(OPENCONFIG_FOLDER) && git checkout $(OPENCONFIG_BRANCH)
rm -rf $(YANG_VENDORED_BASE_PATH)/$(OPENCONFIG_FOLDER)/.git

rm -rf $(YANG_VENDORED_BASE_PATH)/$(NTC_YANG_FOLDER)
git clone $(NTC_YANG_REPO) $(YANG_VENDORED_BASE_PATH)/$(NTC_YANG_FOLDER)
cd $(YANG_VENDORED_BASE_PATH)/$(NTC_YANG_FOLDER) && git checkout $(NTC_YANG_BRANCH)
rm -rf $(YANG_VENDORED_BASE_PATH)/$(NTC_YANG_FOLDER)/.git
4 changes: 2 additions & 2 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CHANGELOG
=========

develop
-------
0.1.0
-----

- first version
8 changes: 6 additions & 2 deletions docs/build_supported_models.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Dict, List, Type, Union
Expand All @@ -18,7 +19,7 @@
SchemaTreeNode,
)

models = ("openconfig",)
models = ("openconfig", "ntc")
drivers = ("ios", "junos")

LintClass = Union[
Expand Down Expand Up @@ -119,7 +120,10 @@ def _process_schema_child(
for platform, linted_platform in linted.items():
r = SchemaResult(implemented=False, metadata={})
if parent in linted_platform:
if child.name in linted_platform[parent].implements:
if (
child.name.replace("-", "_")
in linted_platform[parent].implements
):
r = SchemaResult(implemented=True, metadata={})
results[child.data_path()][platform] = r
elif isinstance(child, (GroupNode, LeafListNode)):
Expand Down
1 change: 1 addition & 0 deletions docs/models/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ Models
:maxdepth: 1

openconfig/index
ntc/index
matrix/index
Loading

0 comments on commit 8d8f607

Please sign in to comment.