diff --git a/docs/inventory/inventory.md b/docs/inventory/inventory.md index d24bf2f..a88dce4 100644 --- a/docs/inventory/inventory.md +++ b/docs/inventory/inventory.md @@ -39,19 +39,26 @@ With the Nornir Nautobot Inventory plugin you have the option of using all of th ## Filtering Examples -For each of the examples the sites correspond to the first three letters of the devices below: +For each of the examples the locations correspond to the first three letters of the devices below: ```python >>> nautobot.dcim.devices.all() [den-rtr01, den-rtr02, grb-rtr01, msp-rtr01, msp-rtr02, nyc-rtr01, nyc-rtr02] ``` -### Filtering Example: Select from single site +### Filtering Example: Select from single location + +To filter from a single location you can use the filter location to get the devices at a single location based on the **Primary Key** for the location: + +> NOTE: Location names do not guarantee uniqueness in Nautobot 2.0. +> +> See this document for more information: +> +> https://docs.nautobot.com/projects/core/en/next/development/apps/api/platform-features/uniquely-identify-objects/ -To filter from a single site you can use the filter site to get the devices at a single site based on the **slug** for the site: ```python -site = "msp" +location = "db913e3b-cbe0-4463-addc-816ba6a20100" my_nornir = InitNornir( inventory={ @@ -59,7 +66,7 @@ my_nornir = InitNornir( "options": { "nautobot_url": os.getenv("NAUTOBOT_URL"), "nautobot_token": os.getenv("NAUTBOT_TOKEN"), - "filter_parameters": {"site": site}, + "filter_parameters": {"location": location}, "ssl_verify": False, }, }, @@ -73,18 +80,18 @@ print(my_nornir.inventory.hosts.keys()) This results in: ``` -root@2e8168a1c3e7:/local# python examples/filter_site.py +root@2e8168a1c3e7:/local# python examples/filter_location.py Hosts found: 2 dict_keys(['msp-rtr01', 'msp-rtr02']) ``` -### Filter Example: Multiple Sites +### Filter Example: Multiple Locations -To search within multiple sites, pass a list of site slugs. In the example below, it is the same as the previous example with a list passed in instead of a single string. +To search within multiple locations, pass a list of location Primary Keys. In the example below, it is the same as the previous example with a list passed in instead of a single string. ```python -site = ["msp", "grb"] +location = ["db913e3b-cbe0-4463-addc-816ba6a20100", "6f09aa66-96be-4b4d-955a-9c98e488f0e6"] my_nornir = InitNornir( inventory={ @@ -92,7 +99,7 @@ my_nornir = InitNornir( "options": { "nautobot_url": os.getenv("NAUTOBOT_URL"), "nautobot_token": os.getenv("NAUTBOT_TOKEN"), - "filter_parameters": {"site": site}, + "filter_parameters": {"location": location}, "ssl_verify": False, }, }, @@ -106,17 +113,17 @@ print(my_nornir.inventory.hosts.keys()) Results in: ``` -root@2e8168a1c3e7:/local# python examples/filter_multiple_sites.py +root@2e8168a1c3e7:/local# python examples/filter_multiple_locations.py Hosts found: 3 dict_keys(['grb-rtr01', 'msp-rtr01', 'msp-rtr02']) ``` -### Filtering Example: Not at a site +### Filtering Example: Not at a location The negative filters also are supported. These are all of the filters possible. Here we will search for devices **not** at _MSP_: ```python -not_site = "msp" +not_location = "db913e3b-cbe0-4463-addc-816ba6a20100" my_nornir = InitNornir( inventory={ @@ -124,7 +131,7 @@ my_nornir = InitNornir( "options": { "nautobot_url": os.getenv("NAUTOBOT_URL"), "nautobot_token": os.getenv("NAUTBOT_TOKEN"), - "filter_parameters": {"site__n": not_site}, + "filter_parameters": {"location__n": not_location}, "ssl_verify": False, }, }, @@ -138,7 +145,7 @@ print(my_nornir.inventory.hosts.keys()) Results in: ``` -root@2e8168a1c3e7:/local# python examples/filter_negate_site.py +root@2e8168a1c3e7:/local# python examples/filter_negate_location.py Hosts found: 5 dict_keys(['den-rtr01', 'den-rtr02', 'grb-rtr01', 'nyc-rtr01', 'nyc-rtr02']) ``` diff --git a/examples/filter_multiple_sites.py b/examples/filter_location.py similarity index 90% rename from examples/filter_multiple_sites.py rename to examples/filter_location.py index b113497..3eedf76 100644 --- a/examples/filter_multiple_sites.py +++ b/examples/filter_location.py @@ -22,7 +22,7 @@ def hello_world(task: Task) -> Result: def main(): """Nornir testing.""" - site = ["msp", "grb"] + location = "db913e3b-cbe0-4463-addc-816ba6a20100" my_nornir = InitNornir( inventory={ @@ -30,7 +30,7 @@ def main(): "options": { "nautobot_url": os.getenv("NAUTOBOT_URL"), "nautobot_token": os.getenv("NAUTBOT_TOKEN"), - "filter_parameters": {"site": site}, + "filter_parameters": {"location": location}, "ssl_verify": False, }, }, diff --git a/examples/filter_site.py b/examples/filter_multiple_locations.py similarity index 87% rename from examples/filter_site.py rename to examples/filter_multiple_locations.py index d0e9c78..d230bc5 100644 --- a/examples/filter_site.py +++ b/examples/filter_multiple_locations.py @@ -22,7 +22,7 @@ def hello_world(task: Task) -> Result: def main(): """Nornir testing.""" - site = "msp" + location = ["db913e3b-cbe0-4463-addc-816ba6a20100", "6f09aa66-96be-4b4d-955a-9c98e488f0e6"] my_nornir = InitNornir( inventory={ @@ -30,7 +30,7 @@ def main(): "options": { "nautobot_url": os.getenv("NAUTOBOT_URL"), "nautobot_token": os.getenv("NAUTBOT_TOKEN"), - "filter_parameters": {"site": site}, + "filter_parameters": {"location": location}, "ssl_verify": False, }, }, diff --git a/examples/filter_negate_site.py b/examples/filter_negate_location.py similarity index 89% rename from examples/filter_negate_site.py rename to examples/filter_negate_location.py index b8b0c6c..265e425 100644 --- a/examples/filter_negate_site.py +++ b/examples/filter_negate_location.py @@ -22,7 +22,7 @@ def hello_world(task: Task) -> Result: def main(): """Nornir testing.""" - not_site = "msp" + not_location = "db913e3b-cbe0-4463-addc-816ba6a20100" my_nornir = InitNornir( inventory={ @@ -30,7 +30,7 @@ def main(): "options": { "nautobot_url": os.getenv("NAUTOBOT_URL"), "nautobot_token": os.getenv("NAUTBOT_TOKEN"), - "filter_parameters": {"site__n": not_site}, + "filter_parameters": {"location__n": not_location}, "ssl_verify": False, }, }, diff --git a/nornir_nautobot/plugins/inventory/nautobot.py b/nornir_nautobot/plugins/inventory/nautobot.py index f681c48..d2727ec 100644 --- a/nornir_nautobot/plugins/inventory/nautobot.py +++ b/nornir_nautobot/plugins/inventory/nautobot.py @@ -25,7 +25,7 @@ def _set_host(data: Dict[str, Any], name: str, groups, host, defaults: Defaults) -> Host: - host_platform = getattr(data["pynautobot_object"].platform, "slug", None) + host_platform = getattr(data["pynautobot_object"].platform, "network_driver", None) connection_option = {} for key, value in data.get("connection_options", {}).items(): connection_option[key] = ConnectionOptions( @@ -106,6 +106,7 @@ def pynautobot_obj(self) -> pynautobot.core.api.Api: """ if self._pynautobot_obj is None: self._pynautobot_obj = pynautobot.api(self.nautobot_url, token=self.nautobot_token) + self.api_session.params = {"depth": 1} self._pynautobot_obj.http_session = self.api_session return self._pynautobot_obj @@ -120,8 +121,8 @@ def devices(self) -> list: else: try: self._devices = self.pynautobot_obj.dcim.devices.filter(**self.filter_parameters) - except pynautobot.core.query.RequestError: - print("Error in the query filters. Please verify the parameters.") + except pynautobot.core.query.RequestError as err: + print(f"Error in the query filters: {err.error}. Please verify the parameters.") sys.exit(1) return self._devices @@ -151,7 +152,11 @@ def load(self) -> Inventory: # Add Primary IP address, if found. Otherwise add hostname as the device name host["hostname"] = ( - str(ipaddress.IPv4Interface(device.primary_ip.address).ip) if device["primary_ip"] else device["name"] + str(ipaddress.IPv4Interface(device.primary_ip4.address).ip) + if device["primary_ip4"] + else str(ipaddress.IPv6Interface(device.primary_ip6.address).ip) + if device["primary_ip6"] + else device["name"] ) host["name"] = device.name or str(device.id) host["groups"] = [] diff --git a/nornir_nautobot/plugins/tasks/dispatcher/default.py b/nornir_nautobot/plugins/tasks/dispatcher/default.py index 254a9fe..bdd0021 100644 --- a/nornir_nautobot/plugins/tasks/dispatcher/default.py +++ b/nornir_nautobot/plugins/tasks/dispatcher/default.py @@ -91,7 +91,7 @@ def compliance_config( features (dict): A dictionary describing the configurations required. backup_file (str): The file location of where the back configuration should be saved. intended_file (str): The file location of where the intended configuration should be saved. - platform (str): The platform slug of the device. + platform (str): The platform network_driver of the device. Returns: Result: Nornir Result object with a feature_data key of the compliance data. @@ -268,7 +268,8 @@ def get_config( if result[0].failed: # TODO: investigate this, is there a better way to handle? recursive function? logger.log_error( - f"`get_config` nornir task failed with an unexpected issue: `{str(result.exception)}`", extra={"object": obj} + f"`get_config` nornir task failed with an unexpected issue: `{str(result.exception)}`", + extra={"object": obj}, ) return result diff --git a/nornir_nautobot/utils/logger.py b/nornir_nautobot/utils/logger.py index 83265de..bf506a7 100644 --- a/nornir_nautobot/utils/logger.py +++ b/nornir_nautobot/utils/logger.py @@ -15,32 +15,32 @@ def __init__(self, name: str, nautobot_job=None, debug: bool = False, job_result self.debug = debug self.nautobot_job = nautobot_job or job_result - def log_debug(self, message: str, extra: Any=None): + def log_debug(self, message: str, extra: Any = None): """Debug, does not take obj, and only logs to jobs result when in global debug mode.""" if self.nautobot_job and self.debug: self.nautobot_job.logging.debug(message, extra=extra) self.logger.debug(message) - def log_info(self, message: str, extra: Any=None): + def log_info(self, message: str, extra: Any = None): """Log to Python logger and jogs results for info messages.""" if self.nautobot_job: self.nautobot_job.logging.info(message, extra=extra) self.logger.info("%s | %s", str(extra), message) - def log_warning(self, message: str, extra: Any=None): + def log_warning(self, message: str, extra: Any = None): """Log to Python logger and jogs results for warning messages.""" if self.nautobot_job: self.nautobot_job.logging.warning(message, extra=extra) self.logger.warning("%s | %s", str(extra), message) - def log_error(self, message: str, extra: Any=None): + def log_error(self, message: str, extra: Any = None): """Log to Python logger and jogs results for error messages.""" if self.nautobot_job: self.nautobot_job.logging.error(message, extra=extra) self.logger.error("%s | %s", str(extra), message) - def log_critical(self, message: str, extra: Any=None): + def log_critical(self, message: str, extra: Any = None): """Log to Python logger and jogs results for critical messages.""" if self.nautobot_job: self.nautobot_job.logging.critical(message, extra=extra) - self.logger.critical("%s | %s", str(extra), message) \ No newline at end of file + self.logger.critical("%s | %s", str(extra), message) diff --git a/poetry.lock b/poetry.lock index 518461c..6c24985 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,9 +1,10 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand. [[package]] name = "anyio" version = "4.0.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -25,6 +26,7 @@ trio = ["trio (>=0.22)"] name = "astroid" version = "2.15.6" description = "An abstract syntax tree for Python with inference support." +category = "dev" optional = false python-versions = ">=3.7.2" files = [ @@ -44,6 +46,7 @@ wrapt = [ name = "babel" version = "2.12.1" description = "Internationalization utilities" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -58,6 +61,7 @@ pytz = {version = ">=2015.7", markers = "python_version < \"3.9\""} name = "bandit" version = "1.7.5" description = "Security oriented static analyser for python code." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -81,6 +85,7 @@ yaml = ["PyYAML"] name = "bcrypt" version = "4.0.1" description = "Modern password hashing for your software and your servers" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -115,6 +120,7 @@ typecheck = ["mypy"] name = "beautifulsoup4" version = "4.12.2" description = "Screen-scraping library" +category = "dev" optional = false python-versions = ">=3.6.0" files = [ @@ -131,33 +137,34 @@ lxml = ["lxml"] [[package]] name = "black" -version = "23.7.0" +version = "23.9.1" description = "The uncompromising code formatter." +category = "dev" optional = false python-versions = ">=3.8" files = [ - {file = "black-23.7.0-cp310-cp310-macosx_10_16_arm64.whl", hash = "sha256:5c4bc552ab52f6c1c506ccae05681fab58c3f72d59ae6e6639e8885e94fe2587"}, - {file = "black-23.7.0-cp310-cp310-macosx_10_16_universal2.whl", hash = "sha256:552513d5cd5694590d7ef6f46e1767a4df9af168d449ff767b13b084c020e63f"}, - {file = "black-23.7.0-cp310-cp310-macosx_10_16_x86_64.whl", hash = "sha256:86cee259349b4448adb4ef9b204bb4467aae74a386bce85d56ba4f5dc0da27be"}, - {file = "black-23.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:501387a9edcb75d7ae8a4412bb8749900386eaef258f1aefab18adddea1936bc"}, - {file = "black-23.7.0-cp310-cp310-win_amd64.whl", hash = "sha256:fb074d8b213749fa1d077d630db0d5f8cc3b2ae63587ad4116e8a436e9bbe995"}, - {file = "black-23.7.0-cp311-cp311-macosx_10_16_arm64.whl", hash = "sha256:b5b0ee6d96b345a8b420100b7d71ebfdd19fab5e8301aff48ec270042cd40ac2"}, - {file = "black-23.7.0-cp311-cp311-macosx_10_16_universal2.whl", hash = "sha256:893695a76b140881531062d48476ebe4a48f5d1e9388177e175d76234ca247cd"}, - {file = "black-23.7.0-cp311-cp311-macosx_10_16_x86_64.whl", hash = "sha256:c333286dc3ddca6fdff74670b911cccedacb4ef0a60b34e491b8a67c833b343a"}, - {file = "black-23.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:831d8f54c3a8c8cf55f64d0422ee875eecac26f5f649fb6c1df65316b67c8926"}, - {file = "black-23.7.0-cp311-cp311-win_amd64.whl", hash = "sha256:7f3bf2dec7d541b4619b8ce526bda74a6b0bffc480a163fed32eb8b3c9aed8ad"}, - {file = "black-23.7.0-cp38-cp38-macosx_10_16_arm64.whl", hash = "sha256:f9062af71c59c004cd519e2fb8f5d25d39e46d3af011b41ab43b9c74e27e236f"}, - {file = "black-23.7.0-cp38-cp38-macosx_10_16_universal2.whl", hash = "sha256:01ede61aac8c154b55f35301fac3e730baf0c9cf8120f65a9cd61a81cfb4a0c3"}, - {file = "black-23.7.0-cp38-cp38-macosx_10_16_x86_64.whl", hash = "sha256:327a8c2550ddc573b51e2c352adb88143464bb9d92c10416feb86b0f5aee5ff6"}, - {file = "black-23.7.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d1c6022b86f83b632d06f2b02774134def5d4d4f1dac8bef16d90cda18ba28a"}, - {file = "black-23.7.0-cp38-cp38-win_amd64.whl", hash = "sha256:27eb7a0c71604d5de083757fbdb245b1a4fae60e9596514c6ec497eb63f95320"}, - {file = "black-23.7.0-cp39-cp39-macosx_10_16_arm64.whl", hash = "sha256:8417dbd2f57b5701492cd46edcecc4f9208dc75529bcf76c514864e48da867d9"}, - {file = "black-23.7.0-cp39-cp39-macosx_10_16_universal2.whl", hash = "sha256:47e56d83aad53ca140da0af87678fb38e44fd6bc0af71eebab2d1f59b1acf1d3"}, - {file = "black-23.7.0-cp39-cp39-macosx_10_16_x86_64.whl", hash = "sha256:25cc308838fe71f7065df53aedd20327969d05671bac95b38fdf37ebe70ac087"}, - {file = "black-23.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:642496b675095d423f9b8448243336f8ec71c9d4d57ec17bf795b67f08132a91"}, - {file = "black-23.7.0-cp39-cp39-win_amd64.whl", hash = "sha256:ad0014efc7acf0bd745792bd0d8857413652979200ab924fbf239062adc12491"}, - {file = "black-23.7.0-py3-none-any.whl", hash = "sha256:9fd59d418c60c0348505f2ddf9609c1e1de8e7493eab96198fc89d9f865e7a96"}, - {file = "black-23.7.0.tar.gz", hash = "sha256:022a582720b0d9480ed82576c920a8c1dde97cc38ff11d8d8859b3bd6ca9eedb"}, + {file = "black-23.9.1-cp310-cp310-macosx_10_16_arm64.whl", hash = "sha256:d6bc09188020c9ac2555a498949401ab35bb6bf76d4e0f8ee251694664df6301"}, + {file = "black-23.9.1-cp310-cp310-macosx_10_16_universal2.whl", hash = "sha256:13ef033794029b85dfea8032c9d3b92b42b526f1ff4bf13b2182ce4e917f5100"}, + {file = "black-23.9.1-cp310-cp310-macosx_10_16_x86_64.whl", hash = "sha256:75a2dc41b183d4872d3a500d2b9c9016e67ed95738a3624f4751a0cb4818fe71"}, + {file = "black-23.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:13a2e4a93bb8ca74a749b6974925c27219bb3df4d42fc45e948a5d9feb5122b7"}, + {file = "black-23.9.1-cp310-cp310-win_amd64.whl", hash = "sha256:adc3e4442eef57f99b5590b245a328aad19c99552e0bdc7f0b04db6656debd80"}, + {file = "black-23.9.1-cp311-cp311-macosx_10_16_arm64.whl", hash = "sha256:8431445bf62d2a914b541da7ab3e2b4f3bc052d2ccbf157ebad18ea126efb91f"}, + {file = "black-23.9.1-cp311-cp311-macosx_10_16_universal2.whl", hash = "sha256:8fc1ddcf83f996247505db6b715294eba56ea9372e107fd54963c7553f2b6dfe"}, + {file = "black-23.9.1-cp311-cp311-macosx_10_16_x86_64.whl", hash = "sha256:7d30ec46de88091e4316b17ae58bbbfc12b2de05e069030f6b747dfc649ad186"}, + {file = "black-23.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:031e8c69f3d3b09e1aa471a926a1eeb0b9071f80b17689a655f7885ac9325a6f"}, + {file = "black-23.9.1-cp311-cp311-win_amd64.whl", hash = "sha256:538efb451cd50f43aba394e9ec7ad55a37598faae3348d723b59ea8e91616300"}, + {file = "black-23.9.1-cp38-cp38-macosx_10_16_arm64.whl", hash = "sha256:638619a559280de0c2aa4d76f504891c9860bb8fa214267358f0a20f27c12948"}, + {file = "black-23.9.1-cp38-cp38-macosx_10_16_universal2.whl", hash = "sha256:a732b82747235e0542c03bf352c126052c0fbc458d8a239a94701175b17d4855"}, + {file = "black-23.9.1-cp38-cp38-macosx_10_16_x86_64.whl", hash = "sha256:cf3a4d00e4cdb6734b64bf23cd4341421e8953615cba6b3670453737a72ec204"}, + {file = "black-23.9.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cf99f3de8b3273a8317681d8194ea222f10e0133a24a7548c73ce44ea1679377"}, + {file = "black-23.9.1-cp38-cp38-win_amd64.whl", hash = "sha256:14f04c990259576acd093871e7e9b14918eb28f1866f91968ff5524293f9c573"}, + {file = "black-23.9.1-cp39-cp39-macosx_10_16_arm64.whl", hash = "sha256:c619f063c2d68f19b2d7270f4cf3192cb81c9ec5bc5ba02df91471d0b88c4c5c"}, + {file = "black-23.9.1-cp39-cp39-macosx_10_16_universal2.whl", hash = "sha256:6a3b50e4b93f43b34a9d3ef00d9b6728b4a722c997c99ab09102fd5efdb88325"}, + {file = "black-23.9.1-cp39-cp39-macosx_10_16_x86_64.whl", hash = "sha256:c46767e8df1b7beefb0899c4a95fb43058fa8500b6db144f4ff3ca38eb2f6393"}, + {file = "black-23.9.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:50254ebfa56aa46a9fdd5d651f9637485068a1adf42270148cd101cdf56e0ad9"}, + {file = "black-23.9.1-cp39-cp39-win_amd64.whl", hash = "sha256:403397c033adbc45c2bd41747da1f7fc7eaa44efbee256b53842470d4ac5a70f"}, + {file = "black-23.9.1-py3-none-any.whl", hash = "sha256:6ccd59584cc834b6d127628713e4b6b968e5f79572da66284532525a042549f9"}, + {file = "black-23.9.1.tar.gz", hash = "sha256:24b6b3ff5c6d9ea08a8888f6977eae858e1f340d7260cf56d70a49823236b62d"}, ] [package.dependencies] @@ -167,7 +174,7 @@ packaging = ">=22.0" pathspec = ">=0.9.0" platformdirs = ">=2" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} +typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} [package.extras] colorama = ["colorama (>=0.4.3)"] @@ -179,6 +186,7 @@ uvloop = ["uvloop (>=0.15.2)"] name = "certifi" version = "2023.7.22" description = "Python package for providing Mozilla's CA Bundle." +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -190,6 +198,7 @@ files = [ name = "cffi" version = "1.15.1" description = "Foreign Function Interface for Python calling C code." +category = "main" optional = false python-versions = "*" files = [ @@ -266,6 +275,7 @@ pycparser = "*" name = "charset-normalizer" version = "3.2.0" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +category = "main" optional = false python-versions = ">=3.7.0" files = [ @@ -350,6 +360,7 @@ files = [ name = "click" version = "8.1.7" description = "Composable command line interface toolkit" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -364,6 +375,7 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." +category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -375,6 +387,7 @@ files = [ name = "cryptography" version = "41.0.3" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -420,6 +433,7 @@ test-randomorder = ["pytest-randomly"] name = "cssselect" version = "1.2.0" description = "cssselect parses CSS3 Selectors and translates them to XPath 1.0" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -431,6 +445,7 @@ files = [ name = "dill" version = "0.3.7" description = "serialize all of Python" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -445,6 +460,7 @@ graph = ["objgraph (>=1.7.2)"] name = "exceptiongroup" version = "1.1.3" description = "Backport of PEP 654 (exception groups)" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -459,6 +475,7 @@ test = ["pytest (>=6)"] name = "flake8" version = "5.0.4" description = "the modular source code checker: pep8 pyflakes and co" +category = "dev" optional = false python-versions = ">=3.6.1" files = [ @@ -475,6 +492,7 @@ pyflakes = ">=2.5.0,<2.6.0" name = "future" version = "0.18.3" description = "Clean single-source support for Python 3 and 2" +category = "main" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -485,6 +503,7 @@ files = [ name = "ghp-import" version = "2.1.0" description = "Copy your docs directly to the gh-pages branch." +category = "dev" optional = false python-versions = "*" files = [ @@ -502,6 +521,7 @@ dev = ["flake8", "markdown", "twine", "wheel"] name = "gitdb" version = "4.0.10" description = "Git Object Database" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -516,6 +536,7 @@ smmap = ">=3.0.1,<6" name = "gitpython" version = "3.1.35" description = "GitPython is a Python library used to interact with Git repositories" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -528,13 +549,14 @@ gitdb = ">=4.0.1,<5" [[package]] name = "griffe" -version = "0.36.1" +version = "0.36.2" description = "Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API." +category = "dev" optional = false python-versions = ">=3.8" files = [ - {file = "griffe-0.36.1-py3-none-any.whl", hash = "sha256:859b653fcde0a0af0e841a0109bac2b63a2f683132ae1ec8dae5fa81e94617a0"}, - {file = "griffe-0.36.1.tar.gz", hash = "sha256:11df63f1c85f605c73e4485de70ec13784049695d228241b0b582364a20c0536"}, + {file = "griffe-0.36.2-py3-none-any.whl", hash = "sha256:ba71895a3f5f606b18dcd950e8a1f8e7332a37f90f24caeb002546593f2e0eee"}, + {file = "griffe-0.36.2.tar.gz", hash = "sha256:333ade7932bb9096781d83092602625dfbfe220e87a039d2801259a1bd41d1c2"}, ] [package.dependencies] @@ -544,6 +566,7 @@ colorama = ">=0.4" name = "h11" version = "0.14.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -555,6 +578,7 @@ files = [ name = "httpcore" version = "0.17.3" description = "A minimal low-level HTTP client." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -566,16 +590,17 @@ files = [ anyio = ">=3.0,<5.0" certifi = "*" h11 = ">=0.13,<0.15" -sniffio = "==1.*" +sniffio = ">=1.0.0,<2.0.0" [package.extras] http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] +socks = ["socksio (>=1.0.0,<2.0.0)"] [[package]] name = "httpx" version = "0.24.1" description = "The next generation HTTP client." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -591,14 +616,15 @@ sniffio = "*" [package.extras] brotli = ["brotli", "brotlicffi"] -cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] +cli = ["click (>=8.0.0,<9.0.0)", "pygments (>=2.0.0,<3.0.0)", "rich (>=10,<14)"] http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] +socks = ["socksio (>=1.0.0,<2.0.0)"] [[package]] name = "idna" version = "3.4" description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" optional = false python-versions = ">=3.5" files = [ @@ -610,6 +636,7 @@ files = [ name = "importlib-metadata" version = "4.13.0" description = "Read metadata from Python packages" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -629,6 +656,7 @@ testing = ["flake8 (<5)", "flufl.flake8", "importlib-resources (>=1.3)", "packag name = "iniconfig" version = "2.0.0" description = "brain-dead simple config-ini parsing" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -640,6 +668,7 @@ files = [ name = "invoke" version = "2.2.0" description = "Pythonic task execution" +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -651,6 +680,7 @@ files = [ name = "isort" version = "5.12.0" description = "A Python utility / library to sort Python imports." +category = "dev" optional = false python-versions = ">=3.8.0" files = [ @@ -668,6 +698,7 @@ requirements-deprecated-finder = ["pip-api", "pipreqs"] name = "jinja2" version = "3.1.2" description = "A very fast and expressive template engine." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -685,6 +716,7 @@ i18n = ["Babel (>=2.7)"] name = "junos-eznc" version = "2.6.7" description = "Junos 'EZ' automation for non-programmers" +category = "main" optional = false python-versions = ">=3.5, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -710,6 +742,7 @@ yamlordereddictloader = "*" name = "lazy-object-proxy" version = "1.9.0" description = "A fast and thorough lazy object proxy." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -755,6 +788,7 @@ files = [ name = "lxml" version = "4.9.3" description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API." +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, != 3.4.*" files = [ @@ -862,6 +896,7 @@ source = ["Cython (>=0.29.35)"] name = "markdown" version = "3.4.4" description = "Python implementation of John Gruber's Markdown." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -880,6 +915,7 @@ testing = ["coverage", "pyyaml"] name = "markdown-it-py" version = "3.0.0" description = "Python port of markdown-it. Markdown parsing, done right!" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -904,6 +940,7 @@ testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] name = "markdown2" version = "2.4.10" description = "A fast and complete Python implementation of Markdown" +category = "dev" optional = false python-versions = ">=3.5, <4" files = [ @@ -920,6 +957,7 @@ wavedrom = ["wavedrom"] name = "markupsafe" version = "2.1.3" description = "Safely add untrusted strings to HTML/XML markup." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -943,16 +981,6 @@ files = [ {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac"}, {file = "MarkupSafe-2.1.3-cp311-cp311-win32.whl", hash = "sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb"}, {file = "MarkupSafe-2.1.3-cp311-cp311-win_amd64.whl", hash = "sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:f698de3fd0c4e6972b92290a45bd9b1536bffe8c6759c62471efaa8acb4c37bc"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:aa57bd9cf8ae831a362185ee444e15a93ecb2e344c8e52e4d721ea3ab6ef1823"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ffcc3f7c66b5f5b7931a5aa68fc9cecc51e685ef90282f4a82f0f5e9b704ad11"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47d4f1c5f80fc62fdd7777d0d40a2e9dda0a05883ab11374334f6c4de38adffd"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1f67c7038d560d92149c060157d623c542173016c4babc0c1913cca0564b9939"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:9aad3c1755095ce347e26488214ef77e0485a3c34a50c5a5e2471dff60b9dd9c"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:14ff806850827afd6b07a5f32bd917fb7f45b046ba40c57abdb636674a8b559c"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8f9293864fe09b8149f0cc42ce56e3f0e54de883a9de90cd427f191c346eb2e1"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-win32.whl", hash = "sha256:715d3562f79d540f251b99ebd6d8baa547118974341db04f5ad06d5ea3eb8007"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-win_amd64.whl", hash = "sha256:1b8dd8c3fd14349433c79fa8abeb573a55fc0fdd769133baac1f5e07abf54aeb"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707"}, @@ -989,6 +1017,7 @@ files = [ name = "mccabe" version = "0.7.0" description = "McCabe checker, plugin for flake8" +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1000,6 +1029,7 @@ files = [ name = "mdurl" version = "0.1.2" description = "Markdown URL utilities" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1011,6 +1041,7 @@ files = [ name = "mergedeep" version = "1.3.4" description = "A deep merge function for 🐍." +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1022,6 +1053,7 @@ files = [ name = "mkdocs" version = "1.5.2" description = "Project documentation with Markdown." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1053,6 +1085,7 @@ min-versions = ["babel (==2.9.0)", "click (==7.0)", "colorama (==0.4)", "ghp-imp name = "mkdocs-autorefs" version = "0.5.0" description = "Automatically link across pages in MkDocs." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1068,6 +1101,7 @@ mkdocs = ">=1.1" name = "mkdocs-material" version = "9.2.4" description = "Documentation that simply works" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1094,6 +1128,7 @@ requests = ">=2.26" name = "mkdocs-material-extensions" version = "1.1.1" description = "Extension pack for Python Markdown and MkDocs Material." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1105,6 +1140,7 @@ files = [ name = "mkdocs-version-annotations" version = "1.0.0" description = "MkDocs plugin to add custom admonitions for documenting version differences" +category = "dev" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -1116,6 +1152,7 @@ files = [ name = "mkdocstrings" version = "0.22.0" description = "Automatic documentation from sources, for MkDocs." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1142,6 +1179,7 @@ python-legacy = ["mkdocstrings-python-legacy (>=0.2.1)"] name = "mkdocstrings-python" version = "1.5.2" description = "A Python handler for mkdocstrings." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1157,6 +1195,7 @@ mkdocstrings = ">=0.20" name = "mypy-extensions" version = "0.4.4" description = "Experimental type system extensions for programs checked with the mypy typechecker." +category = "main" optional = false python-versions = ">=2.7" files = [ @@ -1167,6 +1206,7 @@ files = [ name = "napalm" version = "4.1.0" description = "Network Automation and Programmability Abstraction Layer with Multivendor support" +category = "main" optional = false python-versions = "*" files = [ @@ -1199,6 +1239,7 @@ typing-extensions = ">=4.3.0" name = "ncclient" version = "0.6.13" description = "Python library for NETCONF clients" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -1215,6 +1256,7 @@ six = "*" name = "netaddr" version = "0.8.0" description = "A network address manipulation library for Python" +category = "main" optional = false python-versions = "*" files = [ @@ -1226,6 +1268,7 @@ files = [ name = "netmiko" version = "4.1.2" description = "Multi-vendor library to simplify legacy CLI connections to network devices" +category = "main" optional = false python-versions = "*" files = [ @@ -1247,6 +1290,7 @@ textfsm = "1.1.2" name = "netutils" version = "1.6.0" description = "Common helper functions useful in network automation." +category = "main" optional = false python-versions = ">=3.8,<4.0" files = [ @@ -1261,6 +1305,7 @@ optionals = ["jsonschema (>=4.17.3,<5.0.0)", "napalm (>=4.0.0,<5.0.0)"] name = "nornir" version = "3.3.0" description = "Pluggable multi-threaded framework with inventory management to help operate collections of devices" +category = "main" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -1281,6 +1326,7 @@ docs = ["jupyter (>=1,<2)", "nbsphinx (>=0.8,<0.9)", "pygments (>=2,<3)", "sphin name = "nornir-jinja2" version = "0.2.0" description = "Jinja2 plugins for nornir" +category = "main" optional = false python-versions = ">=3.6,<4.0" files = [ @@ -1296,6 +1342,7 @@ nornir = ">=3,<4" name = "nornir-napalm" version = "0.4.0" description = "NAPALM's plugins for nornir" +category = "main" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -1311,6 +1358,7 @@ nornir = ">=3,<4" name = "nornir-netmiko" version = "1.0.0" description = "Netmiko's plugins for Nornir" +category = "main" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -1326,6 +1374,7 @@ textfsm = "1.1.2" name = "nornir-utils" version = "0.2.0" description = "Collection of plugins and functions for nornir that don't require external dependencies" +category = "main" optional = false python-versions = ">=3.6.2,<4.0.0" files = [ @@ -1341,6 +1390,7 @@ nornir = ">=3,<4" name = "ntc-templates" version = "3.5.0" description = "TextFSM Templates for Network Devices, and Python wrapper for TextFSM's CliTable." +category = "main" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -1355,6 +1405,7 @@ textfsm = ">=1.1.0,<2.0.0" name = "packaging" version = "23.1" description = "Core utilities for Python packages" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1366,6 +1417,7 @@ files = [ name = "paginate" version = "0.5.6" description = "Divides large result sets into pages for easier browsing" +category = "dev" optional = false python-versions = "*" files = [ @@ -1376,6 +1428,7 @@ files = [ name = "paramiko" version = "3.3.1" description = "SSH2 protocol library" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1397,6 +1450,7 @@ invoke = ["invoke (>=2.0)"] name = "pathspec" version = "0.11.2" description = "Utility library for gitignore style pattern matching of file paths." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1408,6 +1462,7 @@ files = [ name = "pbr" version = "5.11.1" description = "Python Build Reasonableness" +category = "dev" optional = false python-versions = ">=2.6" files = [ @@ -1419,6 +1474,7 @@ files = [ name = "platformdirs" version = "3.10.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1434,6 +1490,7 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-co name = "pluggy" version = "1.3.0" description = "plugin and hook calling mechanisms for python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1449,6 +1506,7 @@ testing = ["pytest", "pytest-benchmark"] name = "pycodestyle" version = "2.9.1" description = "Python style guide checker" +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1460,6 +1518,7 @@ files = [ name = "pycparser" version = "2.21" description = "C parser in Python" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -1471,6 +1530,7 @@ files = [ name = "pydantic" version = "1.10.12" description = "Data validation and settings management using python type hints" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1524,6 +1584,7 @@ email = ["email-validator (>=1.0.3)"] name = "pydocstyle" version = "6.3.0" description = "Python docstring style checker" +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1541,6 +1602,7 @@ toml = ["tomli (>=1.2.3)"] name = "pyeapi" version = "1.0.2" description = "Python Client for eAPI" +category = "main" optional = false python-versions = "*" files = [ @@ -1558,6 +1620,7 @@ test = ["coverage", "mock"] name = "pyflakes" version = "2.5.0" description = "passive checker of Python programs" +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1569,6 +1632,7 @@ files = [ name = "pygments" version = "2.16.1" description = "Pygments is a syntax highlighting package written in Python." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1583,6 +1647,7 @@ plugins = ["importlib-metadata"] name = "pylint" version = "2.17.5" description = "python code static checker" +category = "dev" optional = false python-versions = ">=3.7.2" files = [ @@ -1612,6 +1677,7 @@ testutils = ["gitpython (>3)"] name = "pymdown-extensions" version = "10.3" description = "Extension pack for Python Markdown." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1630,6 +1696,7 @@ extra = ["pygments (>=2.12)"] name = "pynacl" version = "1.5.0" description = "Python binding to the Networking and Cryptography (NaCl) library" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1654,13 +1721,14 @@ tests = ["hypothesis (>=3.27.0)", "pytest (>=3.2.1,!=3.3.0)"] [[package]] name = "pynautobot" -version = "1.5.0" +version = "2.0.0rc2" description = "Nautobot API client library" +category = "main" optional = false python-versions = ">=3.7,<4.0" files = [ - {file = "pynautobot-1.5.0-py3-none-any.whl", hash = "sha256:aa5bdf18148d82715b26e1a7abf0796bb28da05fece3d206b6f42749d2f466b1"}, - {file = "pynautobot-1.5.0.tar.gz", hash = "sha256:50ac1e12f377ce2f1d156056e9ec3333c8a74bf6269e145889606da92b8752b4"}, + {file = "pynautobot-2.0.0rc2-py3-none-any.whl", hash = "sha256:2f3f5ece11be8b897524428d0b352985302c0b6528b33ffab24573f148b02c3b"}, + {file = "pynautobot-2.0.0rc2.tar.gz", hash = "sha256:252b9e0a9c7bd6782991ec467d65f4dfe1d8f5118c926f9c53be8156e7b4a2be"}, ] [package.dependencies] @@ -1671,6 +1739,7 @@ urllib3 = ">=1.21.1,<1.27" name = "pyparsing" version = "3.1.1" description = "pyparsing module - Classes and methods to define and execute parsing grammars" +category = "main" optional = false python-versions = ">=3.6.8" files = [ @@ -1685,6 +1754,7 @@ diagrams = ["jinja2", "railroad-diagrams"] name = "pyquery" version = "2.0.0" description = "A jquery-like library for python" +category = "dev" optional = false python-versions = "*" files = [ @@ -1703,6 +1773,7 @@ test = ["pytest", "pytest-cov", "requests", "webob", "webtest"] name = "pyserial" version = "3.5" description = "Python Serial Port Extension" +category = "main" optional = false python-versions = "*" files = [ @@ -1717,6 +1788,7 @@ cp2110 = ["hidapi"] name = "pytest" version = "7.4.2" description = "pytest: simple powerful testing with Python" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1739,6 +1811,7 @@ testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "no name = "python-dateutil" version = "2.8.2" description = "Extensions to the standard Python datetime module" +category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ @@ -1753,6 +1826,7 @@ six = ">=1.5" name = "python-dotenv" version = "1.0.0" description = "Read key-value pairs from a .env file and set them as environment variables" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1767,6 +1841,7 @@ cli = ["click (>=5.0)"] name = "pytz" version = "2023.3.post1" description = "World timezone definitions, modern and historical" +category = "dev" optional = false python-versions = "*" files = [ @@ -1778,6 +1853,7 @@ files = [ name = "pyyaml" version = "6.0.1" description = "YAML parser and emitter for Python" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1837,6 +1913,7 @@ files = [ name = "pyyaml-env-tag" version = "0.1" description = "A custom YAML tag for referencing environment variables in YAML files. " +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1851,6 +1928,7 @@ pyyaml = "*" name = "readtime" version = "3.0.0" description = "Calculates the time some text takes the average human to read, based on Medium's read time forumula" +category = "dev" optional = false python-versions = "*" files = [ @@ -1866,6 +1944,7 @@ pyquery = ">=1.2" name = "regex" version = "2023.8.8" description = "Alternative regular expression module, to replace re." +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1963,6 +2042,7 @@ files = [ name = "requests" version = "2.31.0" description = "Python HTTP for Humans." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1984,6 +2064,7 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] name = "requests-mock" version = "1.11.0" description = "Mock out responses from the requests package" +category = "dev" optional = false python-versions = "*" files = [ @@ -2003,6 +2084,7 @@ test = ["fixtures", "mock", "purl", "pytest", "requests-futures", "sphinx", "tes name = "rich" version = "13.5.2" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" +category = "dev" optional = false python-versions = ">=3.7.0" files = [ @@ -2022,6 +2104,7 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] name = "routeros-api" version = "0.17.0" description = "Python API to RouterBoard devices produced by MikroTik." +category = "main" optional = true python-versions = "*" files = [ @@ -2036,6 +2119,7 @@ six = "*" name = "ruamel-yaml" version = "0.17.32" description = "ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order" +category = "main" optional = false python-versions = ">=3" files = [ @@ -2054,6 +2138,7 @@ jinja2 = ["ruamel.yaml.jinja2 (>=0.2)"] name = "ruamel-yaml-clib" version = "0.2.7" description = "C version of reader, parser and emitter for ruamel.yaml derived from libyaml" +category = "main" optional = false python-versions = ">=3.5" files = [ @@ -2064,8 +2149,7 @@ files = [ {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-win32.whl", hash = "sha256:763d65baa3b952479c4e972669f679fe490eee058d5aa85da483ebae2009d231"}, {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-win_amd64.whl", hash = "sha256:d000f258cf42fec2b1bbf2863c61d7b8918d31ffee905da62dede869254d3b8a"}, {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:045e0626baf1c52e5527bd5db361bc83180faaba2ff586e763d3d5982a876a9e"}, - {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-macosx_13_0_arm64.whl", hash = "sha256:1a6391a7cabb7641c32517539ca42cf84b87b667bad38b78d4d42dd23e957c81"}, - {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-manylinux2014_aarch64.whl", hash = "sha256:9c7617df90c1365638916b98cdd9be833d31d337dbcd722485597b43c4a215bf"}, + {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-macosx_12_6_arm64.whl", hash = "sha256:721bc4ba4525f53f6a611ec0967bdcee61b31df5a56801281027a3a6d1c2daf5"}, {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:41d0f1fa4c6830176eef5b276af04c89320ea616655d01327d5ce65e50575c94"}, {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-win32.whl", hash = "sha256:f6d3d39611ac2e4f62c3128a9eed45f19a6608670c5a2f4f07f24e8de3441d38"}, {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-win_amd64.whl", hash = "sha256:da538167284de58a52109a9b89b8f6a53ff8437dd6dc26d33b57bf6699153122"}, @@ -2100,6 +2184,7 @@ files = [ name = "scp" version = "0.14.5" description = "scp module for paramiko" +category = "main" optional = false python-versions = "*" files = [ @@ -2114,6 +2199,7 @@ paramiko = "*" name = "setuptools" version = "68.2.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2130,6 +2216,7 @@ testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs ( name = "six" version = "1.16.0" description = "Python 2 and 3 compatibility utilities" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -2141,6 +2228,7 @@ files = [ name = "smmap" version = "5.0.0" description = "A pure Python implementation of a sliding window memory map manager" +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -2152,6 +2240,7 @@ files = [ name = "sniffio" version = "1.3.0" description = "Sniff out which async library your code is running under" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2163,6 +2252,7 @@ files = [ name = "snowballstemmer" version = "2.2.0" description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." +category = "dev" optional = false python-versions = "*" files = [ @@ -2174,6 +2264,7 @@ files = [ name = "soupsieve" version = "2.5" description = "A modern CSS selector implementation for Beautiful Soup." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2185,6 +2276,7 @@ files = [ name = "stevedore" version = "5.1.0" description = "Manage dynamic plugins for Python applications" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2199,6 +2291,7 @@ pbr = ">=2.0.0,<2.1.0 || >2.1.0" name = "tenacity" version = "8.2.3" description = "Retry code until it succeeds" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2213,6 +2306,7 @@ doc = ["reno", "sphinx", "tornado (>=4.5)"] name = "textfsm" version = "1.1.2" description = "Python module for parsing semi-structured text into python tables." +category = "main" optional = false python-versions = "*" files = [ @@ -2228,6 +2322,7 @@ six = "*" name = "toml" version = "0.10.2" description = "Python Library for Tom's Obvious, Minimal Language" +category = "dev" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -2239,6 +2334,7 @@ files = [ name = "tomli" version = "2.0.1" description = "A lil' TOML parser" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -2250,6 +2346,7 @@ files = [ name = "tomlkit" version = "0.12.1" description = "Style preserving TOML library" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -2261,6 +2358,7 @@ files = [ name = "transitions" version = "0.9.0" description = "A lightweight, object-oriented Python state machine implementation with many extensions." +category = "main" optional = false python-versions = "*" files = [ @@ -2279,6 +2377,7 @@ test = ["pytest"] name = "ttp" version = "0.9.5" description = "Template Text Parser" +category = "main" optional = false python-versions = ">=2.7,<4.0" files = [ @@ -2294,6 +2393,7 @@ full = ["cerberus (>=1.3.0,<1.4.0)", "deepdiff (>=5.8.0,<5.9.0)", "jinja2 (>=3.0 name = "ttp-templates" version = "0.3.5" description = "Template Text Parser Templates collections" +category = "main" optional = false python-versions = ">=3.6,<4.0" files = [ @@ -2311,6 +2411,7 @@ docs = ["mkdocs (==1.2.4)", "mkdocs-material (==7.2.2)", "mkdocs-material-extens name = "typing-extensions" version = "4.7.1" description = "Backported and Experimental Type Hints for Python 3.7+" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2322,6 +2423,7 @@ files = [ name = "urllib3" version = "1.26.16" description = "HTTP library with thread-safe connection pooling, file post, and more." +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" files = [ @@ -2338,6 +2440,7 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] name = "watchdog" version = "3.0.0" description = "Filesystem events monitoring" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -2377,6 +2480,7 @@ watchmedo = ["PyYAML (>=3.10)"] name = "wrapt" version = "1.15.0" description = "Module for decorators, wrappers and monkey patching." +category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" files = [ @@ -2461,6 +2565,7 @@ files = [ name = "yamllint" version = "1.32.0" description = "A linter for YAML files." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -2479,6 +2584,7 @@ dev = ["doc8", "flake8", "flake8-import-order", "rstcheck[sphinx]", "sphinx"] name = "yamlordereddictloader" version = "0.4.0" description = "YAML loader and dump for PyYAML allowing to keep keys order." +category = "main" optional = false python-versions = "*" files = [ @@ -2492,6 +2598,7 @@ pyyaml = "*" name = "zipp" version = "3.16.2" description = "Backport of pathlib-compatible object wrapper for zip files" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2509,4 +2616,4 @@ mikrotik-driver = ["routeros-api"] [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "728be2cb46ef3e08d1286afab8846f110831620aed33c3e0384d53b41bb960a2" +content-hash = "8dcc6f02b6e6bd9da7ae90da89bca3fbb378d3d14c5817c58bc7aa9c7d708bd0" diff --git a/pyproject.toml b/pyproject.toml index c7f56bb..c5040b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "nornir-nautobot" -version = "3.0.0rc1" +version = "3.0.0" description = "Nornir Nautobot" authors = ["Network to Code, LLC "] readme = "README.md" @@ -17,7 +17,7 @@ classifiers = [ ] repository = "https://github.com/nautobot/nornir-nautobot" homepage = "https://nautobot.com" -documentation = "https://docs.nautobot.com/projects/nornir-nautobot/en/latest/" +documentation = "https://nornir-nautobot.readthedocs.io" [tool.poetry.urls] "Changelog" = "https://docs.nautobot.com/projects/nornir-nautobot/en/latest/dev/CHANGELOG/" @@ -31,7 +31,7 @@ nornir-utils = "^0" nornir-napalm = ">=0.4.0 <1.0.0" nornir-jinja2 = "^0.2.0" nornir-netmiko = "^1" -pynautobot = "^1.5.0" +pynautobot = "v2.0.0-rc.2" netutils = "^1.6.0" routeros-api = {version = "^0.17.0", optional = true} httpx = "^0.24.1" @@ -56,7 +56,6 @@ mkdocstrings = "0.22.0" mkdocstrings-python = "1.5.2" mkdocs-version-annotations = "1.0.0" - [tool.poetry.extras] mikrotik_driver = ["routeros-api"] diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index bb9f98b..f842886 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -1,13 +1,15 @@ """Used to setup fixtures to be used through tests.""" import pytest +import pynautobot from nornir_nautobot.plugins.inventory.nautobot import NautobotInventory @pytest.fixture() -def nornir_nautobot_class(): +def nornir_nautobot_class(monkeypatch): """Provide True to make tests pass. Returns: (bool): Returns True """ + monkeypatch.setattr(pynautobot.api, "version", "2.0") return NautobotInventory(nautobot_url="http://mock.example.com", nautobot_token="0123456789abcdef01234567890") diff --git a/tests/unit/mocks/00_api_root.json b/tests/unit/mocks/00_api_root.json new file mode 100644 index 0000000..5b728d6 --- /dev/null +++ b/tests/unit/mocks/00_api_root.json @@ -0,0 +1,12 @@ +{ + "circuits": "http://localhost:8000/api/circuits/", + "dcim": "http://localhost:8000/api/dcim/", + "extras": "http://localhost:8000/api/extras/", + "graphql": "http://localhost:8000/api/graphql/", + "ipam": "http://localhost:8000/api/ipam/", + "plugins": "http://localhost:8000/api/plugins/", + "status": "http://localhost:8000/api/status/", + "tenancy": "http://localhost:8000/api/tenancy/", + "users": "http://localhost:8000/api/users/", + "virtualization": "http://localhost:8000/api/virtualization/" +} diff --git a/tests/unit/mocks/01_get_devices.json b/tests/unit/mocks/01_get_devices.json index 0afc2c9..800a1b8 100644 --- a/tests/unit/mocks/01_get_devices.json +++ b/tests/unit/mocks/01_get_devices.json @@ -7,7 +7,7 @@ "id": 5, "url": "http://nautobot-demo.com/api/dcim/devices/5/", "name": "den-dist01", - "display_name": "den-dist01", + "display": "den-dist01", "device_type": { "id": 3, "url": "http://nautobot-demo.com/api/dcim/device-types/3/", @@ -19,9 +19,9 @@ }, "model": "IOSv", "slug": "iosv", - "display_name": "Cisco IOSv" + "display": "Cisco IOSv" }, - "device_role": { + "role": { "id": 2, "url": "http://nautobot-demo.com/api/dcim/device-roles/2/", "name": "Network", @@ -31,9 +31,9 @@ "platform": null, "serial": "9ZYX8XZUMP0AF69YGO5Z5", "asset_tag": null, - "site": { + "location": { "id": 4, - "url": "http://nautobot-demo.com/api/dcim/sites/4/", + "url": "http://nautobot-demo.com/api/dcim/locations/4/", "name": "DEN", "slug": "den" }, @@ -63,7 +63,7 @@ "vc_position": null, "vc_priority": null, "comments": "", - "local_context_data": null, + "local_config_context_data": null, "tags": [ { "id": 2, @@ -87,7 +87,7 @@ "id": 6, "url": "http://nautobot-demo.com/api/dcim/devices/6/", "name": "den-dist02", - "display_name": "den-dist02", + "display": "den-dist02", "device_type": { "id": 3, "url": "http://nautobot-demo.com/api/dcim/device-types/3/", @@ -99,9 +99,9 @@ }, "model": "IOSv", "slug": "iosv", - "display_name": "Cisco IOSv" + "display": "Cisco IOSv" }, - "device_role": { + "role": { "id": 2, "url": "http://nautobot-demo.com/api/dcim/device-roles/2/", "name": "Network", @@ -112,13 +112,13 @@ "id": 2, "url": "http://nautobot-demo.com/api/dcim/platforms/2/", "name": "Cisco IOS", - "slug": "ios" + "network_driver": "ios" }, "serial": "94L2AKSPBXNMW5445NAVB", "asset_tag": null, - "site": { + "location": { "id": 4, - "url": "http://nautobot-demo.com/api/dcim/sites/4/", + "url": "http://nautobot-demo.com/api/dcim/locations/4/", "name": "DEN", "slug": "den" }, @@ -148,7 +148,7 @@ "vc_position": null, "vc_priority": null, "comments": "", - "local_context_data": null, + "local_config_context_data": null, "tags": [ { "id": 2, @@ -169,7 +169,7 @@ "id": 4, "url": "http://nautobot-demo.com/api/dcim/devices/4/", "name": "den-wan01", - "display_name": "den-wan01", + "display": "den-wan01", "device_type": { "id": 3, "url": "http://nautobot-demo.com/api/dcim/device-types/3/", @@ -181,9 +181,9 @@ }, "model": "IOSv", "slug": "iosv", - "display_name": "Cisco IOSv" + "display": "Cisco IOSv" }, - "device_role": { + "role": { "id": 3, "url": "http://nautobot-demo.com/api/dcim/device-roles/3/", "name": "Router", @@ -194,13 +194,13 @@ "id": 2, "url": "http://nautobot-demo.com/api/dcim/platforms/2/", "name": "Cisco IOS", - "slug": "ios" + "network_driver": "ios" }, "serial": "90Q1VEN47MPBMU2718KJ1", "asset_tag": null, - "site": { + "location": { "id": 4, - "url": "http://nautobot-demo.com/api/dcim/sites/4/", + "url": "http://nautobot-demo.com/api/dcim/locations/4/", "name": "DEN", "slug": "den" }, @@ -230,7 +230,7 @@ "vc_position": null, "vc_priority": null, "comments": "", - "local_context_data": null, + "local_config_context_data": null, "tags": [ { "id": 2, diff --git a/tests/unit/mocks/02_get_device1.json b/tests/unit/mocks/02_get_device1.json index 9fe2efb..3f721c9 100644 --- a/tests/unit/mocks/02_get_device1.json +++ b/tests/unit/mocks/02_get_device1.json @@ -7,7 +7,7 @@ "id": 5, "url": "http://nautobot-demo.com/api/dcim/devices/5/", "name": "den-dist01", - "display_name": "den-dist01", + "display": "den-dist01", "device_type": { "id": 3, "url": "http://nautobot-demo.com/api/dcim/device-types/3/", @@ -19,9 +19,9 @@ }, "model": "IOSv", "slug": "iosv", - "display_name": "Cisco IOSv" + "display": "Cisco IOSv" }, - "device_role": { + "role": { "id": 2, "url": "http://nautobot-demo.com/api/dcim/device-roles/2/", "name": "Network", @@ -32,13 +32,13 @@ "id": 2, "url": "http://nautobot-demo.com/api/dcim/platforms/2/", "name": "Cisco IOS", - "slug": "ios" + "network_driver": "ios" }, "serial": "9ZYX8XZUMP0AF69YGO5Z5", "asset_tag": null, - "site": { + "location": { "id": 4, - "url": "http://nautobot-demo.com/api/dcim/sites/4/", + "url": "http://nautobot-demo.com/api/dcim/locations/4/", "name": "DEN", "slug": "den" }, @@ -68,7 +68,7 @@ "vc_position": null, "vc_priority": null, "comments": "", - "local_context_data": null, + "local_config_context_data": null, "tags": [ { "id": 2, diff --git a/tests/unit/mocks/03_get_device2.json b/tests/unit/mocks/03_get_device2.json index ddf19a0..401db5b 100644 --- a/tests/unit/mocks/03_get_device2.json +++ b/tests/unit/mocks/03_get_device2.json @@ -7,7 +7,7 @@ "id": 6, "url": "http://nautobot-demo.com/api/dcim/devices/6/", "name": "den-dist02", - "display_name": "den-dist02", + "display": "den-dist02", "device_type": { "id": 3, "url": "http://nautobot-demo.com/api/dcim/device-types/3/", @@ -19,9 +19,9 @@ }, "model": "IOSv", "slug": "iosv", - "display_name": "Cisco IOSv" + "display": "Cisco IOSv" }, - "device_role": { + "role": { "id": 2, "url": "http://nautobot-demo.com/api/dcim/device-roles/2/", "name": "Network", @@ -32,13 +32,13 @@ "id": 2, "url": "http://nautobot-demo.com/api/dcim/platforms/2/", "name": "Cisco IOS", - "slug": "ios" + "network_driver": "ios" }, "serial": "94L2AKSPBXNMW5445NAVB", "asset_tag": null, - "site": { + "location": { "id": 4, - "url": "http://nautobot-demo.com/api/dcim/sites/4/", + "url": "http://nautobot-demo.com/api/dcim/locations/4/", "name": "DEN", "slug": "den" }, @@ -68,7 +68,7 @@ "vc_position": null, "vc_priority": null, "comments": "", - "local_context_data": null, + "local_config_context_data": null, "tags": [ { "id": 2, diff --git a/tests/unit/mocks/04_get_device3.json b/tests/unit/mocks/04_get_device3.json index f3934b9..2e42072 100644 --- a/tests/unit/mocks/04_get_device3.json +++ b/tests/unit/mocks/04_get_device3.json @@ -7,7 +7,7 @@ "id": 4, "url": "http://nautobot-demo.com/api/dcim/devices/4/", "name": "den-wan01", - "display_name": "den-wan01", + "display": "den-wan01", "device_type": { "id": 3, "url": "http://nautobot-demo.com/api/dcim/device-types/3/", @@ -19,9 +19,9 @@ }, "model": "IOSv", "slug": "iosv", - "display_name": "Cisco IOSv" + "display": "Cisco IOSv" }, - "device_role": { + "role": { "id": 3, "url": "http://nautobot-demo.com/api/dcim/device-roles/3/", "name": "Router", @@ -32,13 +32,13 @@ "id": 2, "url": "http://nautobot-demo.com/api/dcim/platforms/2/", "name": "Cisco IOS", - "slug": "ios" + "network_driver": "ios" }, "serial": "90Q1VEN47MPBMU2718KJ1", "asset_tag": null, - "site": { + "location": { "id": 4, - "url": "http://nautobot-demo.com/api/dcim/sites/4/", + "url": "http://nautobot-demo.com/api/dcim/locations/4/", "name": "DEN", "slug": "den" }, @@ -68,7 +68,7 @@ "vc_position": null, "vc_priority": null, "comments": "", - "local_context_data": null, + "local_config_context_data": null, "tags": [ { "id": 2, diff --git a/tests/unit/mocks/05_get_sites_filtered.json b/tests/unit/mocks/05_get_locations_filtered.json similarity index 86% rename from tests/unit/mocks/05_get_sites_filtered.json rename to tests/unit/mocks/05_get_locations_filtered.json index 3dece99..a7b7727 100644 --- a/tests/unit/mocks/05_get_sites_filtered.json +++ b/tests/unit/mocks/05_get_locations_filtered.json @@ -7,7 +7,7 @@ "id": 2, "url": "http://dockerrunner:8000/api/dcim/devices/2/", "name": "msp-rtr01", - "display_name": "msp-rtr01", + "display": "msp-rtr01", "device_type": { "id": 3, "url": "http://dockerrunner:8000/api/dcim/device-types/3/", @@ -19,9 +19,9 @@ }, "model": "IOSv", "slug": "iosv", - "display_name": "Cisco IOSv" + "display": "Cisco IOSv" }, - "device_role": { + "role": { "id": 3, "url": "http://dockerrunner:8000/api/dcim/device-roles/3/", "name": "Router", @@ -32,13 +32,13 @@ "id": 2, "url": "http://dockerrunner:8000/api/dcim/platforms/2/", "name": "Cisco IOS", - "slug": "ios" + "network_driver": "ios" }, "serial": "", "asset_tag": null, - "site": { + "location": { "id": 1, - "url": "http://dockerrunner:8000/api/dcim/sites/1/", + "url": "http://dockerrunner:8000/api/dcim/locations/1/", "name": "MSP", "slug": "msp" }, @@ -58,7 +58,7 @@ "vc_position": null, "vc_priority": null, "comments": "", - "local_context_data": null, + "local_config_context_data": null, "tags": [], "custom_fields": {}, "config_context": {}, @@ -69,7 +69,7 @@ "id": 3, "url": "http://dockerrunner:8000/api/dcim/devices/3/", "name": "msp-rtr02", - "display_name": "msp-rtr02", + "display": "msp-rtr02", "device_type": { "id": 3, "url": "http://dockerrunner:8000/api/dcim/device-types/3/", @@ -81,9 +81,9 @@ }, "model": "IOSv", "slug": "iosv", - "display_name": "Cisco IOSv" + "display": "Cisco IOSv" }, - "device_role": { + "role": { "id": 3, "url": "http://dockerrunner:8000/api/dcim/device-roles/3/", "name": "Router", @@ -94,13 +94,13 @@ "id": 2, "url": "http://dockerrunner:8000/api/dcim/platforms/2/", "name": "Cisco IOS", - "slug": "ios" + "network_driver": "ios" }, "serial": "", "asset_tag": null, - "site": { + "location": { "id": 1, - "url": "http://dockerrunner:8000/api/dcim/sites/1/", + "url": "http://dockerrunner:8000/api/dcim/locations/1/", "name": "MSP", "slug": "msp" }, @@ -120,7 +120,7 @@ "vc_position": null, "vc_priority": null, "comments": "", - "local_context_data": null, + "local_config_context_data": null, "tags": [], "custom_fields": {}, "config_context": {}, diff --git a/tests/unit/mocks/06_get_device_msp-rtr01.json b/tests/unit/mocks/06_get_device_msp-rtr01.json index 59a127a..8f1f69f 100644 --- a/tests/unit/mocks/06_get_device_msp-rtr01.json +++ b/tests/unit/mocks/06_get_device_msp-rtr01.json @@ -7,7 +7,7 @@ "id": 2, "url": "http://dockerrunner:8000/api/dcim/devices/2/", "name": "msp-rtr01", - "display_name": "msp-rtr01", + "display": "msp-rtr01", "device_type": { "id": 3, "url": "http://dockerrunner:8000/api/dcim/device-types/3/", @@ -19,9 +19,9 @@ }, "model": "IOSv", "slug": "iosv", - "display_name": "Cisco IOSv" + "display": "Cisco IOSv" }, - "device_role": { + "role": { "id": 3, "url": "http://dockerrunner:8000/api/dcim/device-roles/3/", "name": "Router", @@ -32,13 +32,13 @@ "id": 2, "url": "http://dockerrunner:8000/api/dcim/platforms/2/", "name": "Cisco IOS", - "slug": "ios" + "network_driver": "ios" }, "serial": "", "asset_tag": null, - "site": { + "location": { "id": 1, - "url": "http://dockerrunner:8000/api/dcim/sites/1/", + "url": "http://dockerrunner:8000/api/dcim/locations/1/", "name": "MSP", "slug": "msp" }, @@ -58,7 +58,7 @@ "vc_position": null, "vc_priority": null, "comments": "", - "local_context_data": null, + "local_config_context_data": null, "tags": [], "custom_fields": {}, "config_context": {}, diff --git a/tests/unit/mocks/07_get_device_msp-rtr02.json b/tests/unit/mocks/07_get_device_msp-rtr02.json index b18f25a..78b690e 100644 --- a/tests/unit/mocks/07_get_device_msp-rtr02.json +++ b/tests/unit/mocks/07_get_device_msp-rtr02.json @@ -7,7 +7,7 @@ "id": 3, "url": "http://dockerrunner:8000/api/dcim/devices/3/", "name": "msp-rtr02", - "display_name": "msp-rtr02", + "display": "msp-rtr02", "device_type": { "id": 3, "url": "http://dockerrunner:8000/api/dcim/device-types/3/", @@ -19,9 +19,9 @@ }, "model": "IOSv", "slug": "iosv", - "display_name": "Cisco IOSv" + "display": "Cisco IOSv" }, - "device_role": { + "role": { "id": 3, "url": "http://dockerrunner:8000/api/dcim/device-roles/3/", "name": "Router", @@ -32,13 +32,13 @@ "id": 2, "url": "http://dockerrunner:8000/api/dcim/platforms/2/", "name": "Cisco IOS", - "slug": "ios" + "network_driver": "ios" }, "serial": "", "asset_tag": null, - "site": { + "location": { "id": 1, - "url": "http://dockerrunner:8000/api/dcim/sites/1/", + "url": "http://dockerrunner:8000/api/dcim/locations/1/", "name": "MSP", "slug": "msp" }, @@ -58,7 +58,7 @@ "vc_position": null, "vc_priority": null, "comments": "", - "local_context_data": null, + "local_config_context_data": null, "tags": [], "custom_fields": {}, "config_context": {}, diff --git a/tests/unit/test_nautobot_inventory.py b/tests/unit/test_nautobot_inventory.py index 7e07257..2e8f6ff 100644 --- a/tests/unit/test_nautobot_inventory.py +++ b/tests/unit/test_nautobot_inventory.py @@ -18,9 +18,14 @@ # GLOBALS HERE = path.abspath(path.dirname(__file__)) API_CALLS = [ + { + "fixture_path": f"{HERE}/mocks/00_api_root.json", + "url": "http://mock.example.com/api/", + "method": "get", + }, { "fixture_path": f"{HERE}/mocks/01_get_devices.json", - "url": "http://mock.example.com/api/dcim/devices/", + "url": "http://mock.example.com/api/dcim/devices/?depth=1", "method": "get", }, { @@ -39,8 +44,8 @@ "method": "get", }, { - "fixture_path": f"{HERE}/mocks/05_get_sites_filtered.json", - "url": "http://mock.example.com/api/dcim/devices/?site=msp", + "fixture_path": f"{HERE}/mocks/05_get_locations_filtered.json", + "url": "http://mock.example.com/api/dcim/devices/?depth=1&location=msp", "method": "get", }, { @@ -131,7 +136,7 @@ def test_filter_devices(): test_class = NautobotInventory( nautobot_url="http://mock.example.com", nautobot_token="0123456789abcdef01234567890", - filter_parameters={"site": "msp"}, + filter_parameters={"location": "msp"}, ) pynautobot_obj = pynautobot.api(url="http://mock.example.com", token="0123456789abcdef01234567890") expected_devices = [] @@ -158,7 +163,7 @@ def mock_nornir_task(task: Task): "options": { "nautobot_url": "http://mock.example.com", "nautobot_token": "0123456789abcdef01234567890", - "filter_parameters": {"site": "msp"}, + "filter_parameters": {"location": "msp"}, }, }, )