Skip to content

Commit

Permalink
Add netconf-openconfig device driver
Browse files Browse the repository at this point in the history
Add the initial part of a device driver using Netconf and
OpenConfig models. Implements network create/delete/update
and port create/delete/update.

Also bump paramiko lower-constrain to 2.3.2, see:
  paramiko/paramiko#1108

Story: 2009961
Task: 44996

Depends-On: https://review.opendev.org//837105
Change-Id: Ifc89923d7f6bbfba25feb2218b80fea9e27b9c4a
  • Loading branch information
hjensas committed Aug 11, 2022
1 parent 30b6008 commit 3b99ee3
Show file tree
Hide file tree
Showing 10 changed files with 1,193 additions and 2 deletions.
10 changes: 8 additions & 2 deletions networking_baremetal/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
from oslo_config import cfg
from oslo_log import log as logging

import networking_baremetal.drivers.netconf.openconfig as netconf_openconfig

CONF = cfg.CONF
LOG = logging.getLogger(__name__)

_opts = [
cfg.ListOpt('enabled_devices',
default=[],
sample_default=['device.example.com'],
sample_default=['generic.example.com',
'netconf-openconfig.example.com'],
help=('Enabled devices for which the plugin should manage'
'configuration. Driver specific configuration for each '
'device must be added in separate sections.')),
Expand Down Expand Up @@ -58,7 +61,10 @@

def list_opts():
return [('networking_baremetal', _opts),
('device.example.com', _device_opts)]
('generic.example.com', _device_opts),
('netconf-openconfig.example.com',
_device_opts + netconf_openconfig._DEVICE_OPTS
+ netconf_openconfig._NCCLIENT_OPTS)]


def get_devices():
Expand Down
669 changes: 669 additions & 0 deletions networking_baremetal/drivers/netconf/openconfig.py

Large diffs are not rendered by default.

Empty file.
Empty file.
500 changes: 500 additions & 0 deletions networking_baremetal/tests/unit/drivers/netconf/test_openconfig.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
features:
- |
Added an `OpenConfig <http://openconfig.net>`__ based device driver
(driver name: ``netconf-openconfig``) using Network Configuration Protocol
(**NETCONF**). Implements network create, delete and update functionality
as well as port create, delete and update.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.

ncclient>=0.6.9 # Apache-2.0
neutron-lib>=1.28.0 # Apache-2.0
oslo.config>=5.2.0 # Apache-2.0
oslo.i18n>=3.15.3 # Apache-2.0
Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ console_scripts =
neutron.ml2.mechanism_drivers =
baremetal = networking_baremetal.plugins.ml2.baremetal_mech:BaremetalMechanismDriver

networking_baremetal.drivers =
netconf-openconfig = networking_baremetal.drivers.netconf.openconfig:NetconfOpenConfigDriver

[pbr]
autodoc_index_modules = True
api_doc_dir = contributor/api
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ python-subunit>=1.0.0 # Apache-2.0/BSD
testtools>=2.2.0 # MIT
stestr>=2.0.0 # Apache-2.0
testscenarios>=0.4 # Apache-2.0/BSD
ncclient>=0.6.9 # Apache-2.0
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html

[testenv:genconfig]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
commands =
oslo-config-generator --config-file=tools/config/networking-baremetal-config-generator.conf

Expand Down

0 comments on commit 3b99ee3

Please sign in to comment.