Skip to content

Commit

Permalink
Fix garbled docstrings in RTD and enable strict checking for Sphinx (n…
Browse files Browse the repository at this point in the history
  • Loading branch information
ogenstad authored and dbarrosop committed May 12, 2018
1 parent ce508b8 commit 90aaa97
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 111 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.PHONY: doctest
doctest:
cd docs && make clean
cd docs && sphinx-build -b html -d _build/doctrees . _build/html
#cd docs && sphinx-build -W -b html -d _build/doctrees . _build/html
cd docs && sphinx-build -W -b html -d _build/doctrees . _build/html
4 changes: 2 additions & 2 deletions docs/support/ios.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ In vim insert, you can also type <ctrl>+V, release only the V, then type C


File Operation Prompts
_____
______________________

By default IOS will prompt for confirmation on file operations. These prompts need to be disabled before the NAPALM-ios driver performs any such operation on the device.
This can be controlled using the `auto_file_prompt` optional arguement:
Expand All @@ -126,7 +126,7 @@ This can be controlled using the `auto_file_prompt` optional arguement:
otherwise a `CommandErrorException` will be raised when file operations are attempted.

SCP File Transfers
_____
__________________

The NAPALM-ios driver requires SCP to be enabled on the managed device. SCP
server functionality is disabled in IOS by default, and is configured using
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/lab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Create a file named ``Vagrantfile`` (no file extension) in your working director
.. literalinclude:: Vagrantfile
:language: ruby

The above content is also available on `GitHub <https://raw.githubusercontent.com/napalm-automation/napalm/master/docs/tutorials/Vagrantfile>`_.
The above content is also available `on GitHub <https://raw.githubusercontent.com/napalm-automation/napalm/master/docs/tutorials/Vagrantfile>`_.

This Vagrantfile creates a base box and a vEOS box when you call ``vagrant up``::

Expand Down
227 changes: 121 additions & 106 deletions napalm/base/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ def get_interfaces(self):
Returns a dictionary of dictionaries. The keys for the first dictionary will be the \
interfaces in the devices. The inner dictionary will containing the following data for \
each interface:
* is_up (True/False)
* is_enabled (True/False)
* description (string)
Expand Down Expand Up @@ -373,36 +374,36 @@ def get_bgp_neighbors(self):
Note, if is_up is False and uptime has a positive value then this indicates the
uptime of the last active BGP session.
Example response:
{
"global": {
"router_id": "10.0.1.1",
"peers": {
"10.0.0.2": {
"local_as": 65000,
"remote_as": 65000,
"remote_id": "10.0.1.2",
"is_up": True,
"is_enabled": True,
"description": "internal-2",
"uptime": 4838400,
"address_family": {
"ipv4": {
"sent_prefixes": 637213,
"accepted_prefixes": 3142,
"received_prefixes": 3142
},
"ipv6": {
"sent_prefixes": 36714,
"accepted_prefixes": 148,
"received_prefixes": 148
Example::
{
"global": {
"router_id": "10.0.1.1",
"peers": {
"10.0.0.2": {
"local_as": 65000,
"remote_as": 65000,
"remote_id": "10.0.1.2",
"is_up": True,
"is_enabled": True,
"description": "internal-2",
"uptime": 4838400,
"address_family": {
"ipv4": {
"sent_prefixes": 637213,
"accepted_prefixes": 3142,
"received_prefixes": 3142
},
"ipv6": {
"sent_prefixes": 36714,
"accepted_prefixes": 148,
"received_prefixes": 148
}
}
}
}
}
}
}
}
"""
raise NotImplementedError

Expand Down Expand Up @@ -542,6 +543,7 @@ def get_bgp_config(self, group='', neighbor=''):
Main dictionary keys represent the group name and the values represent a dictionary having
the keys below. Neighbors which aren't members of a group will be stored in a key named "_":
* type (string)
* description (string)
* apply_groups (string list)
Expand All @@ -555,7 +557,9 @@ def get_bgp_config(self, group='', neighbor=''):
* remove_private_as (True/False)
* prefix_limit (dictionary)
* neighbors (dictionary)
Neighbors is a dictionary of dictionaries with the following keys:
* description (string)
* import_policy (string)
* export_policy (string)
Expand All @@ -566,6 +570,7 @@ def get_bgp_config(self, group='', neighbor=''):
* prefix_limit (dictionary)
* route_reflector_client (True/False)
* nhs (True/False)
The inner dictionary prefix_limit has the same structure for both layers::
{
Expand Down Expand Up @@ -865,6 +870,7 @@ def get_interfaces_ip(self):
'ipv4' and 'ipv6' (one, both or none) which are themselvs dictionaries witht the IP
addresses as keys.
Each IP Address dictionary has the following keys:
* prefix_length (int)
Example::
Expand Down Expand Up @@ -914,6 +920,7 @@ def get_mac_address_table(self):
"""
Returns a lists of dictionaries. Each dictionary represents an entry in the MAC Address
Table, having the following keys:
* mac (string)
* interface (string)
* vlan (int)
Expand Down Expand Up @@ -1083,6 +1090,7 @@ def get_probes_config(self):
The keys of the main dictionary represent the name of the probes.
Each probe consists on multiple tests, each test name being a key in the probe dictionary.
A test has the following keys:
* probe_type (str)
* target (str)
* source (str)
Expand Down Expand Up @@ -1118,6 +1126,7 @@ def get_probes_results(self):
The keys of the main dictionary represent the name of the probes.
Each probe consists on multiple tests, each test name being a key in the probe dictionary.
A test has the following keys:
* target (str)
* source (str)
* probe_type (str)
Expand Down Expand Up @@ -1265,6 +1274,7 @@ def traceroute(self,
In case of success, the keys of the dictionary represent the hop ID, while values are
dictionaries containing the probes results:
* rtt (float)
* ip_address (str)
* host_name (str)
Expand Down Expand Up @@ -1360,6 +1370,7 @@ def get_users(self):
Returns a dictionary with the configured users.
The keys of the main dictionary represents the username. The values represent the details
of the user, represented by the following keys:
* level (int)
* password (str)
* sshkeys (list)
Expand Down Expand Up @@ -1414,39 +1425,39 @@ def get_optics(self):
* min (float)
* max (float)
Example:
Example::
{
'et1': {
'physical_channels': {
'channel': [
{
'index': 0,
'state': {
'input_power': {
'instant': 0.0,
'avg': 0.0,
'min': 0.0,
'max': 0.0,
},
'output_power': {
'instant': 0.0,
'avg': 0.0,
'min': 0.0,
'max': 0.0,
},
'laser_bias_current': {
'instant': 0.0,
'avg': 0.0,
'min': 0.0,
'max': 0.0,
},
}
'et1': {
'physical_channels': {
'channel': [
{
'index': 0,
'state': {
'input_power': {
'instant': 0.0,
'avg': 0.0,
'min': 0.0,
'max': 0.0,
},
'output_power': {
'instant': 0.0,
'avg': 0.0,
'min': 0.0,
'max': 0.0,
},
'laser_bias_current': {
'instant': 0.0,
'avg': 0.0,
'min': 0.0,
'max': 0.0,
},
}
]
}
}
]
}
}
}
"""
raise NotImplementedError

Expand All @@ -1456,10 +1467,11 @@ def get_config(self, retrieve='all'):
Args:
retrieve(string): Which configuration type you want to populate, default is all of them.
The rest will be set to "".
The rest will be set to "".
Returns:
The object returned is a dictionary with the following keys:
The object returned is a dictionary with a key for each configuration store:
- running(string) - Representation of the native running configuration
- candidate(string) - Representation of the native candidate configuration. If the
device doesnt differentiate between running and startup configuration this will an
Expand All @@ -1480,44 +1492,45 @@ def get_network_instances(self, name=''):
Returns:
A dictionary of network instances in OC format:
* name (dict)
* name (unicode)
* type (unicode)
* state (dict)
* route_distinguisher (unicode)
* interfaces (dict)
* interface (dict)
* interface name: (dict)
Example:
{
u'MGMT': {
u'name': u'MGMT',
u'type': u'L3VRF',
u'state': {
u'route_distinguisher': u'123:456',
},
u'interfaces': {
u'interface': {
u'Management1': {}
* name (unicode)
* type (unicode)
* state (dict)
* route_distinguisher (unicode)
* interfaces (dict)
* interface (dict)
* interface name: (dict)
Example::
{
u'MGMT': {
u'name': u'MGMT',
u'type': u'L3VRF',
u'state': {
u'route_distinguisher': u'123:456',
},
u'interfaces': {
u'interface': {
u'Management1': {}
}
}
}
}
u'default': {
u'name': u'default',
u'type': u'DEFAULT_INSTANCE',
u'state': {
u'route_distinguisher': None,
},
u'interfaces: {
u'interface': {
u'Ethernet1': {}
u'Ethernet2': {}
u'Ethernet3': {}
u'Ethernet4': {}
u'default': {
u'name': u'default',
u'type': u'DEFAULT_INSTANCE',
u'state': {
u'route_distinguisher': None,
},
u'interfaces: {
u'interface': {
u'Ethernet1': {}
u'Ethernet2': {}
u'Ethernet3': {}
u'Ethernet4': {}
}
}
}
}
}
"""
raise NotImplementedError

Expand All @@ -1542,23 +1555,23 @@ def get_firewall_policies(self):
Example::
{
'policy_name': [{
'position': 1,
'packet_hits': 200,
'byte_hits': 83883,
'id': '230',
'enabled': True,
'schedule': 'Always',
'log': 'all',
'l3_src': 'any',
'l3_dst': 'any',
'service': 'HTTP',
'src_zone': 'port2',
'dst_zone': 'port3',
'action': 'Permit'
}]
}
{
'policy_name': [{
'position': 1,
'packet_hits': 200,
'byte_hits': 83883,
'id': '230',
'enabled': True,
'schedule': 'Always',
'log': 'all',
'l3_src': 'any',
'l3_dst': 'any',
'service': 'HTTP',
'src_zone': 'port2',
'dst_zone': 'port3',
'action': 'Permit'
}]
}
"""
raise NotImplementedError

Expand All @@ -1567,13 +1580,15 @@ def get_ipv6_neighbors_table(self):
Get IPv6 neighbors table information.
Return a list of dictionaries having the following set of keys:
* interface (string)
* mac (string)
* ip (string)
* age (float) in seconds
* state (string)
For example::
[
{
'interface' : 'MgmtEth0/RSP0/CPU0/0',
Expand Down

0 comments on commit 90aaa97

Please sign in to comment.