From 3c50b2336b82cedb12d7ac12bcfa8c4e582f8c5e Mon Sep 17 00:00:00 2001
From: Erik Reid <erik.reid@geant.org>
Date: Sun, 18 Dec 2022 21:42:28 +0100
Subject: [PATCH] renamed router.py juniper.py
---
docs/source/basic-tools.rst | 2 +-
resource_management/cli.py | 2 +-
resource_management/hardware/{router.py => juniper.py} | 6 ++----
test/test_db_model.py | 2 +-
test/test_parse_router.py | 2 +-
5 files changed, 6 insertions(+), 8 deletions(-)
rename resource_management/hardware/{router.py => juniper.py} (99%)
diff --git a/docs/source/basic-tools.rst b/docs/source/basic-tools.rst
index b223174..5604e01 100644
--- a/docs/source/basic-tools.rst
+++ b/docs/source/basic-tools.rst
@@ -5,4 +5,4 @@ CLI Tools
.. automodule:: resource_management.cli
-.. automodule:: resource_management.hardware.router
+.. automodule:: resource_management.hardware.juniper
diff --git a/resource_management/cli.py b/resource_management/cli.py
index 5967b58..9936f42 100644
--- a/resource_management/cli.py
+++ b/resource_management/cli.py
@@ -31,7 +31,7 @@ import click
import logging
from jsonschema import validate, ValidationError
-from resource_management.hardware.router \
+from resource_management.hardware.juniper \
import load_router_ports, LINE_CARDS_LIST_SCHEMA
from resource_management import db, config, environment
from resource_management.db import model
diff --git a/resource_management/hardware/router.py b/resource_management/hardware/juniper.py
similarity index 99%
rename from resource_management/hardware/router.py
rename to resource_management/hardware/juniper.py
index 46ac7d2..9720f0f 100644
--- a/resource_management/hardware/router.py
+++ b/resource_management/hardware/juniper.py
@@ -5,13 +5,13 @@ router utilities
.. contents:: :local:
-.. autofunction:: resource_management.hardware.router.load_line_cards
+.. autofunction:: resource_management.hardware.router.load_router_ports
cf.
https://www.juniper.net/documentation/us/en/software/junos-pyez/junos-pyez-developer/topics/task/junos-pyez-tables-op-defining.html
https://www.juniper.net/documentation/us/en/software/junos-pyez/junos-pyez-developer/topics/task/junos-pyez-views-op-defining.html
https://github.com/Juniper/py-junos-eznc/blob/master/lib/jnpr/junos/factory/factory_loader.py#L33-L54
-"""
+""" # noqa: E501
import contextlib
import logging
import re
@@ -308,8 +308,6 @@ def load_router_ports(hostname, ssh_config, port=830):
.. asjson::
resource_management.hardware.router.LINE_CARDS_LIST_SCHEMA
-
-
"""
with router(
diff --git a/test/test_db_model.py b/test/test_db_model.py
index 0cbd445..7f9138b 100644
--- a/test/test_db_model.py
+++ b/test/test_db_model.py
@@ -1,7 +1,7 @@
from resource_management.db import model
from resource_management.db import session_scope
from resource_management.cli import _save_router_info
-from resource_management.hardware.router import load_router_ports
+from resource_management.hardware.juniper import load_router_ports
#
# def test_model_sanity_check(resources_db, router_name):
diff --git a/test/test_parse_router.py b/test/test_parse_router.py
index 92ddaab..07b6937 100644
--- a/test/test_parse_router.py
+++ b/test/test_parse_router.py
@@ -3,7 +3,7 @@ import re
from jsonschema import validate
from lxml import etree
-from resource_management.hardware.router \
+from resource_management.hardware.juniper \
import load_router_ports, LINE_CARDS_LIST_SCHEMA
--
GitLab