Skip to content

Commit

Permalink
Merge branch 'master' into close_exception
Browse files Browse the repository at this point in the history
  • Loading branch information
rahkumar651991 authored Sep 14, 2021
2 parents 09efb75 + 0ed282b commit 4ab7271
Show file tree
Hide file tree
Showing 283 changed files with 22,419 additions and 6,648 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[run]
omit =
lib/jnpr/junos/cfg/*
lib/jnpr/junos/_version.py

[report]
show_missing = True
19 changes: 12 additions & 7 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
/docs/*
/tests/*
/vagrant/*
/docs
/tests
/vagrant
/static
INSTALL*
COPYRIGHT
LICENSE
MANIFEST.md
RELEASE-NOTES.md
development.txt
docreq.txt
*.md
*.txt
!requirements.txt
.coveragerc
.gitignore
.travis.yml
MANIFEST.in
env-setup.sh
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib/jnpr/junos/_version.py export-subst
45 changes: 45 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Pylint

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

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.7, 3.8]
exclude:
- os: windows-latest
python-version: 3.8

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
pip install -r requirements.txt
pip install -r development.txt
pip install ntc_templates==1.4.1
pip install textfsm==0.4.1
pip install .
- name: Run black tool
run: |
pip install -U black;
black --check --exclude=docs/* .
- name: Run unit tests
run: |
nosetests -v --with-coverage --cover-package=jnpr.junos --cover-inclusive -a unit
31 changes: 22 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
language: python
sudo: false

python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"

matrix:
include:
- python: 3.7
dist: xenial
- python: 3.8
dist: xenial
- os: windows
language: shell
python: 3.7
before_install:
- choco install python3 --version=3.7.4
- pip install ntc_templates==1.4.1
- pip install textfsm==0.4.1
env:
- PATH=/c/Python37:/c/Python37/Scripts:$PATH
- TRAVIS_PYTHON_VERSION=3.7
- CRYPTOGRAPHY_DONT_BUILD_RUST=1
addons:
apt:
packages:
Expand All @@ -17,8 +26,12 @@ addons:
install:
- "pip install -r development.txt"
- "pip install -r requirements.txt"
- "pip install ."
- if [[ $TRAVIS_PYTHON_VERSION > 3.5 ]]; then pip install -U black; fi

script: nosetests -v --with-coverage --cover-package=jnpr.junos --cover-inclusive -a unit
script:
- if [[ $TRAVIS_PYTHON_VERSION > 3.5 ]]; then black --check --exclude=docs/* . ; fi
- nosetests -v --with-coverage --cover-package=jnpr.junos --cover-inclusive -a unit

after_success:
coveralls
Expand Down
20 changes: 4 additions & 16 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@

Copyright (c) 1999-2013, Juniper Networks Inc.
Copyright (c) 1999-2021, Juniper Networks Inc.
2013, Jeremy Schulman

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
License: Apache 2.0

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

* Neither the name of the Juniper Networks nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY <copyright holder> ''AS IS'' AND ANY
THIS SOFTWARE IS PROVIDED BY Juniper Networks Inc. ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
DISCLAIMED. IN NO EVENT SHALL Juniper Networks Inc. BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
Expand Down
35 changes: 16 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
FROM alpine:3.6

LABEL MAINTAINER="Stephen Steiner <[email protected]>"
FROM alpine:3.12

LABEL net.juniper.description="Junos PyEZ library for Python in a lightweight container." \
net.juniper.maintainer="Stephen Steiner <[email protected]>"

RUN mkdir /source \
&& mkdir /scripts

WORKDIR /source

## Copy project inside the container
ADD setup.py setup.py
ADD requirements.txt requirements.txt
ADD lib lib

## Install dependancies and Pyez
RUN apk update \
&& apk upgrade \
&& apk add build-base python-dev py-pip py-lxml \
ADD setup.* ./
ADD versioneer.py .
ADD requirements.txt .
ADD lib lib
ADD entrypoint.sh /usr/local/bin/.

## Install dependancies and PyEZ
RUN apk add --no-cache build-base python3-dev py-lxml \
libxslt-dev libxml2-dev libffi-dev openssl-dev curl \
ca-certificates openssl wget \
&& update-ca-certificates \
&& pip install --upgrade pip setuptools \
ca-certificates py3-pip bash \
&& pip install -U pip \
&& pip install -r requirements.txt \
&& apk del -r --purge gcc make g++ \
&& python setup.py install \
&& ln -s /usr/bin/python3 /usr/bin/python \
&& pip install . \
&& rm -rf /source/* \
&& rm -rf /var/cache/apk/*
&& chmod +x /usr/local/bin/entrypoint.sh

WORKDIR /scripts

VOLUME /scripts

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
36 changes: 18 additions & 18 deletions INSTALL-FREEBSD.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@

The following are instructions for setting up a system starting from a stock system image.

These instructions were tested on a 64-bit systems from https://github.com/opscode/bento, and using the _Junos PyEZ_ library version 2.1.0.

Operating Systems
---------------
- FreeBSD 10.3
- FreeBSD 11.0
- FreeBSD 10.4
- FreeBSD 11.1

#### Step 1: Install Python and PIP
FreeBSD contains py-junos-eznc in its official repositories. It could be installed from binary packages using pkg package manager or built from sources using ports collection.

##### For Python 2.7:
sudo pkg install py27-pip
##### For Python 3.5:
sudo pkg install python35
curl https://bootstrap.pypa.io/get-pip.py | sudo /usr/local/bin/python3.5
## Installing from binary packages.

#### Step 2: Install packages for Junos PyEZ
##### For Python 2.7
sudo pkg install py27-junos-eznc

sudo pkg install libxml2 libxslt

#### Step 3: Install Junos PyEZ
##### For Python 3.6
sudo pkg install py36-junos-eznc

## Installing from ports collection

#### For Python 2.7
sudo make -C /usr/ports/net-mgmt/py-junos-eznc install clean FLAVOR=py27

#### For Python 3.6
sudo make -C /usr/ports/net-mgmt/py-junos-eznc install clean FLAVOR=py36

sudo pip install junos-eznc

#### Step 4: Verify
## Verify

Once you've completed the above step, you should be able to create a `Device` instance, connect to a Junos system, and display the "facts", as illustrated in the README.md file.

Enjoy!


#### Installing from GitHub
## Installing from GitHub

Development code can be installed directly from GitHub based on any branch, commit, or tag.

Expand Down
Loading

0 comments on commit 4ab7271

Please sign in to comment.