/cisco-olt-client

Python wrapper for cisco's olt boxes commands executed via ssh

Primary LanguagePythonMIT LicenseMIT

cisco_olt_client

Latest Travis CI build status Test coverage status from latest build Updates

Python wrapper for cisco's olt boxes commands executed via ssh

Usage

Get global dhcp config:

>>> from cisco_olt_client.client import OltClient
>>> from cisco_olt_client.command import Command
>>>
>>> with OltClient('host', 'username', 'password') as client:
...     cmd = client.execute('/dhcp/global/show')
...     print(cmd.output)
...
Global DHCP circuit ID Template String:
"$accessnodeid PON $rack/$subrack/$slot/$port:$onuid.$svid"

Get type for each of configured services:

>>> with OltClient('host', 'username', 'password') as client:
...     cmd = client.execute('/services/showconfig')
...     for config_command in map(Command, cmd.output.splitlines()):
...         print(config_command.args['type'])
...
mac bridge
unicast
multicast
unicast
multicast
mac bridge

Installation

TODO:Upload to pypi :)
$ pip install -r https://raw.githubusercontent.com/Vnet-as/cisco-olt-client/master/requirements.txt
$ pip install -e git+https://github.com/Vnet-as/cisco-olt-client.git#egg=cisco_olt_client

Development

Create and activate virtualenv then proceed with:

$ pip install -r requirements.txt

For running tests you will need tox and everything in test-requirements.txt:

$ pip install tox
$ pip install -r test-requirements.txt

Run tests:

$ tox

Dependencies

Compatibility

Tests run against Python versions:

  • 2.7
  • 3.4
  • 3.5
  • 3.5-dev
  • 3.6-dev

Licence

MIT