[Python-modules-commits] [napalm-fortios] 01/03: Import napalm-fortios_0.2.1.orig.tar.gz
Vincent Bernat
bernat at moszumanska.debian.org
Thu Nov 3 20:02:00 UTC 2016
This is an automated email from the git hooks/post-receive script.
bernat pushed a commit to branch master
in repository napalm-fortios.
commit 07deec9611737af0fd42ad981e32c69c6902f799
Author: Vincent Bernat <bernat at debian.org>
Date: Thu Nov 3 20:59:52 2016 +0100
Import napalm-fortios_0.2.1.orig.tar.gz
---
PKG-INFO | 2 +-
napalm_fortios.egg-info/PKG-INFO | 2 +-
napalm_fortios.egg-info/SOURCES.txt | 1 +
napalm_fortios.egg-info/requires.txt | 2 +-
napalm_fortios/__init__.py | 13 ++++++++++++-
napalm_fortios/fortios.py | 23 +++++++++++++++++++++++
requirements.txt | 2 +-
setup.cfg | 7 +++++++
setup.py | 2 +-
9 files changed, 48 insertions(+), 6 deletions(-)
diff --git a/PKG-INFO b/PKG-INFO
index 1ca1980..8db8b3e 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: napalm-fortios
-Version: 0.1.1
+Version: 0.2.1
Summary: Network Automation and Programmability Abstraction Layer with Multivendor support
Home-page: https://github.com/napalm-automation/napalm-fortios
Author: David Barroso
diff --git a/napalm_fortios.egg-info/PKG-INFO b/napalm_fortios.egg-info/PKG-INFO
index 1ca1980..8db8b3e 100644
--- a/napalm_fortios.egg-info/PKG-INFO
+++ b/napalm_fortios.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: napalm-fortios
-Version: 0.1.1
+Version: 0.2.1
Summary: Network Automation and Programmability Abstraction Layer with Multivendor support
Home-page: https://github.com/napalm-automation/napalm-fortios
Author: David Barroso
diff --git a/napalm_fortios.egg-info/SOURCES.txt b/napalm_fortios.egg-info/SOURCES.txt
index 0dfaff4..265c818 100644
--- a/napalm_fortios.egg-info/SOURCES.txt
+++ b/napalm_fortios.egg-info/SOURCES.txt
@@ -1,5 +1,6 @@
MANIFEST.in
requirements.txt
+setup.cfg
setup.py
napalm_fortios/__init__.py
napalm_fortios/fortios.py
diff --git a/napalm_fortios.egg-info/requires.txt b/napalm_fortios.egg-info/requires.txt
index 29a82cd..1454b58 100644
--- a/napalm_fortios.egg-info/requires.txt
+++ b/napalm_fortios.egg-info/requires.txt
@@ -1,2 +1,2 @@
-napalm-base
+napalm-base>=0.18.0
pyFG
diff --git a/napalm_fortios/__init__.py b/napalm_fortios/__init__.py
index a95ba2b..277200a 100644
--- a/napalm_fortios/__init__.py
+++ b/napalm_fortios/__init__.py
@@ -13,4 +13,15 @@
# the License.
"""napalm_fortios package."""
-from fortios import FortiOSDriver
+# Import stdlib
+import pkg_resources
+
+# Import local modules
+from napalm_fortios.fortios import FortiOSDriver
+
+try:
+ __version__ = pkg_resources.get_distribution('napalm-fortios').version
+except pkg_resources.DistributionNotFound:
+ __version__ = "Not installed"
+
+__all__ = ('FortiOSDriver',)
diff --git a/napalm_fortios/fortios.py b/napalm_fortios/fortios.py
index cf47e63..e0a2fcc 100644
--- a/napalm_fortios/fortios.py
+++ b/napalm_fortios/fortios.py
@@ -138,6 +138,29 @@ class FortiOSDriver(NetworkDriver):
self.device.candidate_config['vpn certificate local']['Fortinet_SSLProxy'].del_param('certificate')
self.device.commit()
+ def get_config(self, retrieve="all"):
+ """get_config implementation for FortiOS."""
+ get_startup = retrieve == "all" or retrieve == "startup"
+ get_running = retrieve == "all" or retrieve == "running"
+ get_candidate = retrieve == "all" or retrieve == "candidate"
+
+ if retrieve == "all" or get_running:
+ result = self.execute_command_with_vdom('show')
+ text_result = '\n'.join(result)
+
+ return {
+ 'startup': u"",
+ 'running': unicode(text_result),
+ 'candidate': u"",
+ }
+
+ elif get_startup or get_candidate:
+ return {
+ 'startup': u"",
+ 'running': u"",
+ 'candidate': u"",
+ }
+
def get_facts(self):
system_status = self.get_command_with_vdom('get system status', vdom='global')
performance_status = self.get_command_with_vdom('get system performance status', vdom='global')
diff --git a/requirements.txt b/requirements.txt
index 3b4589b..1454b58 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,2 @@
-napalm_base
+napalm-base>=0.18.0
pyFG
diff --git a/setup.cfg b/setup.cfg
index 861a9f5..5f3d64f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,3 +1,10 @@
+[pylama]
+linters = mccabe,pep8,pyflakes
+ignore = D203,C901
+
+[pylama:pep8]
+max_line_length = 100
+
[egg_info]
tag_build =
tag_date = 0
diff --git a/setup.py b/setup.py
index 99be57b..1af1d89 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ reqs = [str(ir.req) for ir in install_reqs]
setup(
name="napalm-fortios",
- version="0.1.1",
+ version="0.2.1",
packages=find_packages(),
author="David Barroso",
author_email="dbarrosop at dravetech.com",
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/napalm-fortios.git
More information about the Python-modules-commits
mailing list