[Python-modules-commits] [napalm-junos] 04/06: Import napalm-junos_0.4.3.orig.tar.gz
Vincent Bernat
bernat at moszumanska.debian.org
Wed Nov 2 18:53:43 UTC 2016
This is an automated email from the git hooks/post-receive script.
bernat pushed a commit to branch master
in repository napalm-junos.
commit 3765d163f69571541af20259aaad4157e678aeb8
Author: Vincent Bernat <bernat at debian.org>
Date: Wed Nov 2 19:19:26 2016 +0100
Import napalm-junos_0.4.3.orig.tar.gz
---
PKG-INFO | 2 +-
napalm_junos.egg-info/PKG-INFO | 2 +-
napalm_junos.egg-info/requires.txt | 2 +-
napalm_junos/junos.py | 18 +++++++++++++-----
requirements.txt | 2 +-
setup.py | 2 +-
6 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/PKG-INFO b/PKG-INFO
index 268abf9..5eb894d 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: napalm-junos
-Version: 0.4.2
+Version: 0.4.3
Summary: Network Automation and Programmability Abstraction Layer with Multivendor support
Home-page: https://github.com/napalm-automation/napalm-junos
Author: David Barroso, Mircea Ulinic
diff --git a/napalm_junos.egg-info/PKG-INFO b/napalm_junos.egg-info/PKG-INFO
index 268abf9..5eb894d 100644
--- a/napalm_junos.egg-info/PKG-INFO
+++ b/napalm_junos.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: napalm-junos
-Version: 0.4.2
+Version: 0.4.3
Summary: Network Automation and Programmability Abstraction Layer with Multivendor support
Home-page: https://github.com/napalm-automation/napalm-junos
Author: David Barroso, Mircea Ulinic
diff --git a/napalm_junos.egg-info/requires.txt b/napalm_junos.egg-info/requires.txt
index 528542d..1c041d0 100644
--- a/napalm_junos.egg-info/requires.txt
+++ b/napalm_junos.egg-info/requires.txt
@@ -1,2 +1,2 @@
-napalm-base==0.17.0
+napalm-base>=0.18.0
junos-eznc
diff --git a/napalm_junos/junos.py b/napalm_junos/junos.py
index 58edef0..0939b00 100644
--- a/napalm_junos/junos.py
+++ b/napalm_junos/junos.py
@@ -15,6 +15,8 @@
"""Driver for JunOS devices."""
+from __future__ import unicode_literals
+
# import stdlib
import re
import collections
@@ -33,6 +35,7 @@ from jnpr.junos.exception import ConnectTimeoutError
import napalm_base.helpers
from napalm_base.base import NetworkDriver
from napalm_base.utils import string_parsers
+from napalm_base.utils import py23_compat
from napalm_base.exceptions import ConnectionException
from napalm_base.exceptions import MergeConfigException
from napalm_base.exceptions import CommandErrorException
@@ -948,14 +951,15 @@ class JunOSDriver(NetworkDriver):
return mac_address_table
- def get_route_to(self, destination='', protocol=''):
+ def get_route_to(self, destination=None, protocol=None):
"""Return route details to a specific destination, learned from a certain protocol."""
routes = {}
- if not isinstance(destination, str):
+ if not isinstance(destination, py23_compat.string_types):
raise TypeError('Please specify a valid destination!')
- if not isinstance(protocol, str) or protocol.lower() not in ['static', 'bgp', 'isis']:
+ if not isinstance(protocol, py23_compat.string_types) or \
+ protocol.lower() not in ('static', 'bgp', 'isis'):
raise TypeError("Protocol not supported: {protocol}.".format(
protocol=protocol
))
@@ -1253,6 +1257,10 @@ class JunOSDriver(NetworkDriver):
d[0]: d[1] for d in user_entry[1] if d[1]
})
user_class = user_details.pop('class', '')
+ user_details = {
+ key: py23_compat.text_type(user_details[key])
+ for key in user_details.keys()
+ }
level = _JUNOS_CLASS_CISCO_PRIVILEGE_LEVEL_MAP.get(user_class, 0)
user_details.update({
'level': level
@@ -1335,11 +1343,11 @@ class JunOSDriver(NetworkDriver):
if retrieve in ('candidate', 'all'):
config = self.device.rpc.get_config(filter_xml=None, options=options)
- rv['candidate'] = config.text.encode('ascii', 'replace')
+ rv['candidate'] = py23_compat.text_type(config.text.encode('ascii', 'replace'))
if retrieve in ('running', 'all'):
options['database'] = 'committed'
config = self.device.rpc.get_config(filter_xml=None, options=options)
- rv['running'] = config.text.encode('ascii', 'replace')
+ rv['running'] = py23_compat.text_type(config.text.encode('ascii', 'replace'))
return rv
diff --git a/requirements.txt b/requirements.txt
index 8bf9044..1c041d0 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,2 @@
-napalm_base==0.17.0
+napalm-base>=0.18.0
junos-eznc
diff --git a/setup.py b/setup.py
index 9ce4e2d..97a0abd 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ reqs = [str(ir.req) for ir in install_reqs]
setup(
name="napalm-junos",
- version="0.4.2",
+ version="0.4.3",
packages=find_packages(),
author="David Barroso, Mircea Ulinic",
author_email="dbarrosop at dravetech.com, mircea at cloudflare.com",
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/napalm-junos.git
More information about the Python-modules-commits
mailing list