Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install the module
run: |
python -m pip install .
- name: Test with pytest
run: |
pytest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
/testbed/
__pycache__/
/dist/
/terraform-provider-junos-vqfx-evpn-vxlan/
6 changes: 2 additions & 4 deletions examples/providers/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

set -e

(cd ../../.. && git clone https://github.com/Juniper/yang.git 2>&1 | grep "destination path 'yang' already exists")
jtaf-yang2go -p ../yang/18.2/18.2R3/common ../yang/18.2/18.2R3/junos-qfx/conf/*.yang -x ../evpn-vxlan-dc/dc1/dc1-*leaf* ../evpn-vxlan-dc/dc1/dc1-*spine* ../evpn-vxlan-dc/dc2/dc2-*spine* -t vqfx-evpn-vxlan

jtaf-yang2go -p ../../../yang/18.2/18.2R3/common ../../../yang/18.2/18.2R3/junos-qfx/conf/*.yang -x ../evpn-vxlan-dc/dc1/dc1-*leaf* ../evpn-vxlan-dc/dc1/dc1-*spine* ../evpn-vxlan-dc/dc2/dc2-*spine* -t vqfx-evpn-vxlan

jtaf-yang2go -p ../../../yang/18.2/18.2R3/common ../../../yang/18.2/18.2R3/junos-es/conf/*.yang -x ../evpn-vxlan-dc/dc1/dc1-*firewall* ../evpn-vxlan-dc/dc2/dc2-*firewall* -t vsrx-evpn-vxlan
jtaf-yang2go -p ../yang/18.2/18.2R3/common ../yang/18.2/18.2R3/junos-es/conf/*.yang -x ../evpn-vxlan-dc/dc1/dc1-*firewall* ../evpn-vxlan-dc/dc2/dc2-*firewall* -t vsrx-evpn-vxlan
42 changes: 42 additions & 0 deletions examples/yang/18.2/18.2R3/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Juniper YANG modules
====================

This package contains the configuration and operational YANG modules for
various JUNOS families. Each family has its own directory and contains the
family specific files. The 'common' directory contains the family independent
files and as the name suggests, is common across all families. The
*-with-extensions directories contain the corresponding YANG modules with
references to Junos extensions modules.

Package--+-common (Common modules like extensions)
|
+-<family>-+-conf (Configuration YANG modules)
|
+-rpc (Operational commands YANG modules)
|
+-conf-with-extensions (Configuration YANG with Junos extensions)
|
+-rpc-with-extensions (Operational YANG with Junos extensions)

Each JUNOS 'family' is a grouping of similar platforms :

junos : M/MX, T/TX, Some EX platforms, ACX
junos-es : SRX, Jseries, LN-*
junos-ex : EX series
junos-qfx : QFX series
junos-nfx : NFX series

The command "show system information" can be used to find what 'family' a
device belongs to. This command is supported from Junos 17.2 onwards.

Ex:

user@test> show system information
Model: mx240
Family: junos <-----This is the device family
Junos: 17.2R1.1
Hostname: test




Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright (c) 2019 Juniper Networks, Inc.
* All rights reserved.
*/
module junos-common-ddl-extensions {
namespace "http://yang.juniper.net/junos/common/ddl-extensions";

prefix junos;

organization "Juniper Networks, Inc.";

contact "yang-support@juniper.net";

description "This module contains definitions for Junos YANG extensions.";

revision 2019-01-01 {
description "Junos: 18.2R3";
}

extension must {
argument "stmt-algebra";
description "
expression of configuration-statement paths having special
keywords like any, all, unique";
}
extension must-message {
argument "message-string";
description "
When specifying the junos:must constraint, a must-message should
also be specified so that when the contraint is not met,the
warning message informs users what the constraints are.

If the must-message is missing, the input file will compile,
but the warning message will say (null) which won't be
helpful for users to fix the problem";
}
extension posix-pattern {
argument "value";
description "
expression of pattern in posix format";
}
extension pattern-message {
argument "value";
description "
Error message in case of mismatch";
}
extension command {
argument "command";
description "
The junos cli command for this rpc";
}
extension action-execute {
description "
The junos action execute for rpc";
}
extension script {
argument "script";
description "
The junos action execute script for rpc";
}
extension trans-script {
argument "value";
description "
List of space seperated tranlsation scripts invoked by
associated hierarchy";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*
* Copyright (c) 2019 Juniper Networks, Inc.
* All rights reserved.
*/
module junos-common-odl-extensions {
namespace "http://yang.juniper.net/junos/common/odl-extensions";

prefix junos-odl;

organization "Juniper Networks, Inc.";

contact "yang-support@juniper.net";

description "This module contains definitions for Junos YANG ODL extensions";

revision 2019-01-01 {
description "Junos: 18.2R3";
}

extension header {
argument "header";
description "ODL format header";
}
extension header-group {
argument "header-group";
description "ODL format header group";
}
extension picture {
argument "picture";
description "ODL format picture";
}
extension line {
description "ODL line statement";
}
extension field {
argument "field";
description "ODL field statement";
}
extension style {
argument "style";
description "ODL format style";
}
extension template {
argument "template";
description "ODL format template";
}
extension indent {
argument "indent";
description "Indent the display to right";
}
extension default-text {
argument "default-text";
description "ODL default text for missing field";
}
extension formal-name {
argument "formal-name";
description "ODL formal name for rendering";
}
extension capitalize {
description "ODL flag to capitalize the text output";
}
extension colon {
description "ODL flag for colon";
}
extension explicit {
description "ODL flag for explicit";
}
extension fieldwrap {
description "ODL flag for fieldwrap";
}
extension float {
description "ODL flag for float";
}
extension leading {
description "ODL flag for leading";
}
extension space {
description "ODL flag for space";
}
extension truncate {
description "ODL flag for truncate";
}
extension wordwrap {
description "ODL flag for wordwrap";
}
extension comma {
description "ODL flag for comma";
}
extension cli-format {
description "Flag for container used for cli rendering";
}
extension no-line-break {
description "ODL flag for no linebreak";
}
extension blank-line {
description "ODL flag for no blank line";
}
}
Loading