diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..8be2a5f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,35 @@ +language: python + +python: + - 2.7 + +install: + - pip install -r requirements.txt + - pip install . + +deploy: + provider: pypi + user: dbarroso + password: + secure: FWTA4L2e08mMpD8BbCNWTZN1XFCQKSlYUfPqT0aXDz/GgEK2KfZqbzj1V8Xwx4pXuBHSy8JunlpLGdc18dqtfMKpryz7elWbIsvyPNvcVFxYatG1RdDZB3qiN0MWTCVOCTUyOeglbOsaahKlV66RGBRbQpx107woZ/I+hg43jeNdi6fUer5Ip2DXLMFkR7yb5vbI+tc9KM1Z3/isSzmpkYWQm1MUGxnFonye46r6MoSOANTDpzNIAQKOKwUvGwdovZCAhdqn8JQp8EsKB9Tl0QK56k2//TWmOlglvwL3vVHOeP0V12fc8viKvYRGXKSCwzcz+bi5RSGo0Afurc7lVrmHgJbJIfXxilucE0OBOn58487wynn3k+30D39V9PnddYJ6iNU1ji7/qYpCbyE9ydSKFu4rFgwDbFTU1kJ+JlmNmoJYET/rZITQNUjtFC9grtjSdpouurzNS4eSg7CD8EfzVV6i3IS+1p9n4xosUxdCRl8/jhm9pNMW2OaM00r4GwW2Xt4kDP9J8OWDhlErDLE5lR4EjuGPCLmCYTWcl3DtvUlDCqBs5JZutHV+6raHBw7qFUcI2MxacjQys/3etjIUb9UilbBP1cnqec5Q/FfcTvD0QXCT56f1eM87eh4ysxmHFIDrW+ZwaDW/DicOExfeq264bYOge01poQEkdGM= + on: + tags: true + branch: master + +script: + - cd test/unit + - nosetests -v TestJunOSDriver:TestGetterJunOSDriver.test_get_bgp_config + - nosetests -v TestJunOSDriver:TestGetterJunOSDriver.test_get_bgp_neighbors + - nosetests -v TestJunOSDriver:TestGetterJunOSDriver.test_bgp_neighbors_detail + - nosetests -v TestJunOSDriver:TestGetterJunOSDriver.test_get_environment + - nosetests -v TestJunOSDriver:TestGetterJunOSDriver.test_get_facts + - nosetests -v TestJunOSDriver:TestGetterJunOSDriver.test_get_interfaces + - nosetests -v TestJunOSDriver:TestGetterJunOSDriver.test_get_interfaces_counters + - nosetests -v TestJunOSDriver:TestGetterJunOSDriver.test_get_lldp_neighbors + - nosetests -v TestJunOSDriver:TestGetterJunOSDriver.test_get_lldp_neighbors_detail + - nosetests -v TestJunOSDriver:TestGetterJunOSDriver.test_get_arp_table + - nosetests -v TestJunOSDriver:TestGetterJunOSDriver.test_get_ntp_peers + - nosetests -v TestJunOSDriver:TestGetterJunOSDriver.test_get_interfaces_ip + - nosetests -v TestJunOSDriver:TestGetterJunOSDriver.test_get_mac_address_table + - nosetests -v TestJunOSDriver:TestGetterJunOSDriver.test_get_route_to + - nosetests -v TestJunOSDriver:TestGetterJunOSDriver.test_get_snmp_information diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..566e0a0 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,4 @@ +include requirements.txt +include napalm_junos/utils/*.yml +include napalm_junos/templates/*.j2 +include napalm_junos/utils/textfsm_templates/*.tpl diff --git a/napalm_junos/__init__.py b/napalm_junos/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/napalm/junos.py b/napalm_junos/junos.py similarity index 99% rename from napalm/junos.py rename to napalm_junos/junos.py index 1e20db5..5c4f3fd 100644 --- a/napalm/junos.py +++ b/napalm_junos/junos.py @@ -15,19 +15,16 @@ import re import collections -from napalm.utils import junos_views -from base import NetworkDriver +from napalm_junos.utils import junos_views +from napalm_base.base import NetworkDriver from jnpr.junos import Device from jnpr.junos.utils.config import Config from jnpr.junos.exception import ConfigLoadError, ConnectTimeoutError -from exceptions import ConnectionException, ReplaceConfigException, MergeConfigException, CommandErrorException +from napalm_base.exceptions import ConnectionException, ReplaceConfigException, MergeConfigException,\ + CommandErrorException -from lxml import etree as ET - -from exceptions import ReplaceConfigException, MergeConfigException - -from utils import string_parsers +from napalm_base.utils import string_parsers class JunOSDriver(NetworkDriver): diff --git a/napalm/templates/junos/delete_ntp_peers.j2 b/napalm_junos/templates/junos/delete_ntp_peers.j2 similarity index 100% rename from napalm/templates/junos/delete_ntp_peers.j2 rename to napalm_junos/templates/junos/delete_ntp_peers.j2 diff --git a/napalm/templates/junos/delete_rpm_probes.j2 b/napalm_junos/templates/junos/delete_rpm_probes.j2 similarity index 100% rename from napalm/templates/junos/delete_rpm_probes.j2 rename to napalm_junos/templates/junos/delete_rpm_probes.j2 diff --git a/napalm/templates/junos/set_ntp_peers.j2 b/napalm_junos/templates/junos/set_ntp_peers.j2 similarity index 100% rename from napalm/templates/junos/set_ntp_peers.j2 rename to napalm_junos/templates/junos/set_ntp_peers.j2 diff --git a/napalm/templates/junos/set_rpm_probes.j2 b/napalm_junos/templates/junos/set_rpm_probes.j2 similarity index 100% rename from napalm/templates/junos/set_rpm_probes.j2 rename to napalm_junos/templates/junos/set_rpm_probes.j2 diff --git a/napalm/utils/__init__.py b/napalm_junos/utils/__init__.py similarity index 100% rename from napalm/utils/__init__.py rename to napalm_junos/utils/__init__.py diff --git a/napalm/utils/junos_views.py b/napalm_junos/utils/junos_views.py similarity index 100% rename from napalm/utils/junos_views.py rename to napalm_junos/utils/junos_views.py diff --git a/napalm/utils/junos_views.yml b/napalm_junos/utils/junos_views.yml similarity index 100% rename from napalm/utils/junos_views.yml rename to napalm_junos/utils/junos_views.yml diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..b309748 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +junos-eznc diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..8d8aee4 --- /dev/null +++ b/setup.py @@ -0,0 +1,29 @@ +"""setup.py file.""" + +import uuid + +from setuptools import setup, find_packages +from pip.req import parse_requirements + +__author__ = 'David Barroso ' + +install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1()) +reqs = [str(ir.req) for ir in install_reqs] + +setup( + name="napalm-junos", + version="0.1.0", + packages=find_packages(), + author="David Barroso", + author_email="dbarrosop@dravetech.com", + description="Network Automation and Programmability Abstraction Layer with Multivendor support", + classifiers=[ + 'Topic :: Utilities', + 'Programming Language :: Python', + 'Operating System :: POSIX :: Linux', + 'Operating System :: MacOS', + ], + url="https://github.com/napalm-automation/napalm-junos", + include_package_data=True, + install_requires=reqs, +) diff --git a/test/unit/TestJunOSDriver.py b/test/unit/TestJunOSDriver.py index 90f99eb..a967e9d 100644 --- a/test/unit/TestJunOSDriver.py +++ b/test/unit/TestJunOSDriver.py @@ -14,8 +14,8 @@ import unittest -from napalm.junos import JunOSDriver -from base import TestConfigNetworkDriver, TestGettersNetworkDriver +from napalm_junos.junos import JunOSDriver +from napalm_base.test.base import TestConfigNetworkDriver, TestGettersNetworkDriver import lxml