First working version
This commit is contained in:
1 parent
ceca746a3f
commit
59200aad34
9 files changed
+82
-6
No files matched your search
+22
@@ -0,0 +1,22 @@
|
|||||||
|
language: python
|
||||||
|
python:
|
||||||
|
- 2.7
|
||||||
|
install:
|
||||||
|
- pip install -r requirements.txt
|
||||||
|
- pip install .
|
||||||
|
deploy:
|
||||||
|
provider: pypi
|
||||||
|
user: dbarroso
|
||||||
|
password:
|
||||||
|
secure: rc45r+LLfen9hE709M0voQ9bfyRbNE++lDVjuPG/qhVQHeYQnFijvT7c/ErFCkFdv+QzdvhM+8XLRYcQL98IJ+FvK7XFJdqZ26zNWKnyylLmT35FfNFOFsj95nitM3XO84es5PpOGZFINxUDg3QVHdN/jstzSJVSr7kHLlkvUFeFLUI5sDW0vlBIrSAs1bfL1ZFypkHnNyZPtvJn+Z4dkUw7Oe4+JfzEDBzKfs/cmxz7PpkSsKqmbYaFaCWTah3Sv7JAKFLEFYIVC19isj+ZGu4y6X1JDpe6OI2XBClpAeQRMO0Ae1RRuQTtmYcjzl55+RdKO3nP+cldSK3FoZbRvx36zv6zV9nD32MX+Jf3HhaHPWkolcLGmb4tiaKUfFuE/eEO3IPMP+5P+JqCn429h6MnP0xcggE9aKcSlcs5WWn69J29fkrvSrNIzuZcvjbGEqnGq8Wh6/RIOZbgE1jNlCjuKFtRLib9rQP0+RiUx7nOoakeul7PM5LpK+G9cPJKUPcATiI5d9VqspKsfsYeYSMpMSYNCRFz96W7b5JjwTKnZllHU2O3049WJPrnOvq9ZR2klbw5QGnfOV3RsdXv3FbV7eveXc3eeEXCok74CWmygAZ+OxHI6B0LRA35QRWRwjnyA4RVGvZjKusiJt+2HvQuyrURCieS58Wvl/81gwE=
|
||||||
|
on:
|
||||||
|
tags: true
|
||||||
|
branch: master
|
||||||
|
script:
|
||||||
|
- cd test/unit
|
||||||
|
- nosetests -v TestFortiOSDriver:TestGetterFortiOSDriver.test_get_bgp_neighbors
|
||||||
|
- nosetests -v TestFortiOSDriver:TestGetterFortiOSDriver.test_get_environment
|
||||||
|
- nosetests -v TestFortiOSDriver:TestGetterFortiOSDriver.test_get_facts
|
||||||
|
- nosetests -v TestFortiOSDriver:TestGetterFortiOSDriver.test_get_interfaces
|
||||||
|
- nosetests -v TestFortiOSDriver:TestGetterFortiOSDriver.test_get_interfaces_counters
|
||||||
|
- cd ../..
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
include requirements.txt
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
[](https://pypi.python.org/pypi/napalm-fortios)
|
||||||
|
[](https://pypi.python.org/pypi/napalm-fortios)
|
||||||
|
[](https://travis-ci.org/napalm-automation/napalm-fortios)
|
||||||
|
|
||||||
|
# napalm-fortios
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# Copyright 2016 Dravetech AB. All rights reserved.
|
||||||
|
#
|
||||||
|
# The contents of this file are licensed under the Apache License, Version 2.0
|
||||||
|
# (the "License"); you may not use this file except in compliance with the
|
||||||
|
# License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations under
|
||||||
|
# the License.
|
||||||
|
|
||||||
|
"""napalm_fortios package."""
|
||||||
@@ -14,9 +14,9 @@
|
|||||||
import re
|
import re
|
||||||
from pyFG.fortios import FortiOS, FortiConfig, logger
|
from pyFG.fortios import FortiOS, FortiConfig, logger
|
||||||
from pyFG.exceptions import FailedCommit, CommandExecutionException
|
from pyFG.exceptions import FailedCommit, CommandExecutionException
|
||||||
from base import NetworkDriver
|
from napalm_base.base import NetworkDriver
|
||||||
from exceptions import ReplaceConfigException, MergeConfigException
|
from napalm_base.exceptions import ReplaceConfigException, MergeConfigException
|
||||||
from napalm.utils.string_parsers import colon_separated_string_to_dict, convert_uptime_string_seconds
|
from napalm_base.utils.string_parsers import colon_separated_string_to_dict, convert_uptime_string_seconds
|
||||||
|
|
||||||
|
|
||||||
class FortiOSDriver(NetworkDriver):
|
class FortiOSDriver(NetworkDriver):
|
||||||
@@ -410,4 +410,3 @@ class FortiOSDriver(NetworkDriver):
|
|||||||
out['power'] = {t: {'status': True, 'capacity': -1.0, 'output': -1.0} for t in psus}
|
out['power'] = {t: {'status': True, 'capacity': -1.0, 'output': -1.0} for t in psus}
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
config system global
|
||||||
|
set hostname "{{hostname}}”
|
||||||
|
end
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
napalm_base
|
||||||
|
pyFG
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
"""setup.py file."""
|
||||||
|
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
from setuptools import setup, find_packages
|
||||||
|
from pip.req import parse_requirements
|
||||||
|
|
||||||
|
__author__ = 'David Barroso <dbarrosop@dravetech.com>'
|
||||||
|
|
||||||
|
install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1())
|
||||||
|
reqs = [str(ir.req) for ir in install_reqs]
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name="napalm-fortios",
|
||||||
|
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-fortios",
|
||||||
|
include_package_data=True,
|
||||||
|
install_requires=reqs,
|
||||||
|
)
|
||||||
@@ -14,8 +14,8 @@
|
|||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from napalm.fortios import FortiOSDriver
|
from napalm_fortios.fortios import FortiOSDriver
|
||||||
from base import TestConfigNetworkDriver, TestGettersNetworkDriver
|
from napalm_base.test.base import TestConfigNetworkDriver, TestGettersNetworkDriver
|
||||||
from pyFG.fortios import FortiConfig
|
from pyFG.fortios import FortiConfig
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user