Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pynetbox for openSUSE:Factory checked in at 2023-09-08 21:15:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pynetbox (Old) and /work/SRC/openSUSE:Factory/.python-pynetbox.new.1766 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pynetbox" Fri Sep 8 21:15:58 2023 rev:35 rq:1109632 version:7.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pynetbox/python-pynetbox.changes 2023-08-31 13:51:33.256739456 +0200 +++ /work/SRC/openSUSE:Factory/.python-pynetbox.new.1766/python-pynetbox.changes 2023-09-08 21:16:57.513510289 +0200 @@ -1,0 +2,6 @@ +Thu Sep 7 15:49:27 UTC 2023 - Martin Hauke <mar...@gmx.de> + +- Update to version 7.2.0 + * Add support for NetBox v3.6. + +------------------------------------------------------------------- Old: ---- pynetbox-7.1.0.tar.gz New: ---- pynetbox-7.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pynetbox.spec ++++++ --- /var/tmp/diff_new_pack.g76ZDB/_old 2023-09-08 21:16:58.537546887 +0200 +++ /var/tmp/diff_new_pack.g76ZDB/_new 2023-09-08 21:16:58.537546887 +0200 @@ -18,7 +18,7 @@ %define skip_python2 1 Name: python-pynetbox -Version: 7.1.0 +Version: 7.2.0 Release: 0 Summary: NetBox API client library License: Apache-2.0 ++++++ pynetbox-7.1.0.tar.gz -> pynetbox-7.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/.github/ISSUE_TEMPLATE/bug_report.yaml new/pynetbox-7.2.0/.github/ISSUE_TEMPLATE/bug_report.yaml --- old/pynetbox-7.1.0/.github/ISSUE_TEMPLATE/bug_report.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/pynetbox-7.2.0/.github/ISSUE_TEMPLATE/bug_report.yaml 2023-09-07 17:42:40.000000000 +0200 @@ -0,0 +1,68 @@ +--- +name: ð Bug Report +description: Report a reproducible bug in the current release of pynetbox +labels: ["type: bug"] +body: + - type: markdown + attributes: + value: > + **NOTE:** This form is only for reporting _reproducible bugs_ in a current pynetbox release. + - type: input + attributes: + label: pynetbox version + description: What version of pynetbox are you currently running? + placeholder: v7.1.0 + validations: + required: true + - type: input + attributes: + label: NetBox version + description: What version of NetBox are you currently running? + placeholder: v3.6.0 + validations: + required: true + - type: dropdown + attributes: + label: Python version + description: What version of Python are you currently running? + options: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + validations: + required: true + - type: textarea + attributes: + label: Steps to Reproduce + description: > + Please provide a minimal working example to demonstrate the bug. Begin with the + initialization of any necessary database objects and clearly enumerate each + operation carried out. Ensure that your example is as concise as possible + while adequately illustrating the issue. For example: + ```python + >>> import pynetbox + >>> nb = pynebox.api('https://netbox.example.com', token='my-token') + + ``` + Note: **do not utilize the demo instance** for replicating suspected bugs, + as its data is subject to change or removal at any time. + + _Please refrain from including any confidential or sensitive + information in your example._ + validations: + required: true + - type: textarea + attributes: + label: Expected Behavior + description: What did you expect to happen? + placeholder: The script should execute without raising any errors or exceptions + validations: + required: true + - type: textarea + attributes: + label: Observed Behavior + description: What happened instead? + placeholder: A TypeError exception was raised + validations: + required: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/.github/ISSUE_TEMPLATE/config.yml new/pynetbox-7.2.0/.github/ISSUE_TEMPLATE/config.yml --- old/pynetbox-7.1.0/.github/ISSUE_TEMPLATE/config.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/pynetbox-7.2.0/.github/ISSUE_TEMPLATE/config.yml 2023-09-07 17:42:40.000000000 +0200 @@ -0,0 +1,12 @@ +# Reference: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser +blank_issues_enabled: false +contact_links: + - name: ð Contributing Policy + url: https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md + about: "Please read through our contributing policy before opening an issue or pull request." + - name: â Discussion + url: https://github.com/netbox-community/pynetbox/discussions + about: "If you're just looking for help, try starting a discussion instead." + - name: ð¬ Community Slack + url: https://netdev.chat + about: "Join #netbox on the NetDev Community Slack for assistance with installation issues and other problems." diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/.github/ISSUE_TEMPLATE/deprecation.yaml new/pynetbox-7.2.0/.github/ISSUE_TEMPLATE/deprecation.yaml --- old/pynetbox-7.1.0/.github/ISSUE_TEMPLATE/deprecation.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/pynetbox-7.2.0/.github/ISSUE_TEMPLATE/deprecation.yaml 2023-09-07 17:42:40.000000000 +0200 @@ -0,0 +1,24 @@ +--- +name: ðï¸ Deprecation +description: The removal of an existing feature or resource +labels: ["type: deprecation"] +body: + - type: textarea + attributes: + label: Proposed Changes + description: > + Describe in detail the proposed changes. What is being removed? + validations: + required: true + - type: textarea + attributes: + label: Justification + description: Please provide justification for the proposed change(s). + validations: + required: true + - type: textarea + attributes: + label: Impact + description: List all areas of the application that will be affected by this change. + validations: + required: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/.github/ISSUE_TEMPLATE/documentation_change.yaml new/pynetbox-7.2.0/.github/ISSUE_TEMPLATE/documentation_change.yaml --- old/pynetbox-7.1.0/.github/ISSUE_TEMPLATE/documentation_change.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/pynetbox-7.2.0/.github/ISSUE_TEMPLATE/documentation_change.yaml 2023-09-07 17:42:40.000000000 +0200 @@ -0,0 +1,34 @@ +--- +name: ð Documentation Change +description: Suggest an addition or modification to the pynetbox documentation +labels: ["type: documentation"] +body: + - type: dropdown + attributes: + label: Change Type + description: What type of change are you proposing? + options: + - Addition + - Correction + - Removal + - Cleanup (formatting, typos, etc.) + validations: + required: true + - type: dropdown + attributes: + label: Area + description: To what section of the documentation does this change primarily pertain? + options: + - Endpoint + - Response + - Request + - IPAM + - Other + validations: + required: true + - type: textarea + attributes: + label: Proposed Changes + description: Describe the proposed changes and why they are necessary. + validations: + required: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/.github/ISSUE_TEMPLATE/feature_request.yaml new/pynetbox-7.2.0/.github/ISSUE_TEMPLATE/feature_request.yaml --- old/pynetbox-7.1.0/.github/ISSUE_TEMPLATE/feature_request.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/pynetbox-7.2.0/.github/ISSUE_TEMPLATE/feature_request.yaml 2023-09-07 17:42:40.000000000 +0200 @@ -0,0 +1,59 @@ +--- +name: ⨠Feature Request +description: Propose a new pynetbox feature or enhancement +labels: ["type: feature"] +body: + - type: markdown + attributes: + value: > + **NOTE:** This form is only for submitting well-formed proposals to extend or modify + pynetbox in some way. If you're trying to solve a problem but can't figure out how, or if + you still need time to work on the details of a proposed new feature, please start a + [discussion](https://github.com/netbox-community/pynetbox/discussions) instead. + - type: input + attributes: + label: pynetbox version + description: What version of pynetbox are you currently running? + placeholder: v7.1.0 + validations: + required: true + - type: input + attributes: + label: NetBox version + description: What version of NetBox are you currently running? + placeholder: v3.6.0 + validations: + required: true + - type: dropdown + attributes: + label: Feature type + options: + - Data model extension + - New functionality + - Change to existing functionality + validations: + required: true + - type: textarea + attributes: + label: Proposed functionality + description: > + Describe in detail the new feature or behavior you are proposing. Include any specific changes + to work flows, data models, and/or the user interface. The more detail you provide here, the + greater chance your proposal has of being discussed. Feature requests which don't include an + actionable implementation plan will be rejected. + validations: + required: true + - type: textarea + attributes: + label: Use case + description: > + Explain how adding this functionality would benefit pynetbox users. What need does it address? + validations: + required: true + - type: textarea + attributes: + label: External dependencies + description: > + List any new dependencies on external libraries or services that this new feature would + introduce. For example, does the proposal require the installation of a new Python package? + (Not all new features introduce new dependencies.) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/.github/ISSUE_TEMPLATE/housekeeping.yaml new/pynetbox-7.2.0/.github/ISSUE_TEMPLATE/housekeeping.yaml --- old/pynetbox-7.1.0/.github/ISSUE_TEMPLATE/housekeeping.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/pynetbox-7.2.0/.github/ISSUE_TEMPLATE/housekeeping.yaml 2023-09-07 17:42:40.000000000 +0200 @@ -0,0 +1,24 @@ +--- +name: ð¡ Housekeeping +description: A change pertaining to the codebase itself (developers only) +labels: ["type: housekeeping"] +body: + - type: markdown + attributes: + value: > + **NOTE:** This template is for use by maintainers only. Please do not submit + an issue using this template unless you have been specifically asked to do so. + - type: textarea + attributes: + label: Proposed Changes + description: > + Describe in detail the new feature or behavior you'd like to propose. + Include any specific changes to work flows, data models, or the user interface. + validations: + required: true + - type: textarea + attributes: + label: Justification + description: Please provide justification for the proposed change(s). + validations: + required: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/.github/PULL_REQUEST_TEMPLATE.md new/pynetbox-7.2.0/.github/PULL_REQUEST_TEMPLATE.md --- old/pynetbox-7.1.0/.github/PULL_REQUEST_TEMPLATE.md 1970-01-01 01:00:00.000000000 +0100 +++ new/pynetbox-7.2.0/.github/PULL_REQUEST_TEMPLATE.md 2023-09-07 17:42:40.000000000 +0200 @@ -0,0 +1,17 @@ +<!-- + Thank you for your interest in contributing to pynetbox! Please note that + our contribution policy requires that a feature request or bug report be + approved and assigned prior to opening a pull request. This helps avoid + waste time and effort on a proposed change that we might not be able to + accept. + + IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED + TO YOU, IT WILL BE CLOSED AUTOMATICALLY. + + Please specify your assigned issue number on the line below. +--> +### Fixes: #1234 + +<!-- + Please include a summary of the proposed changes below. +--> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/.github/workflows/py3.yml new/pynetbox-7.2.0/.github/workflows/py3.yml --- old/pynetbox-7.1.0/.github/workflows/py3.yml 2023-08-25 23:32:09.000000000 +0200 +++ new/pynetbox-7.2.0/.github/workflows/py3.yml 2023-09-07 17:42:40.000000000 +0200 @@ -12,8 +12,8 @@ runs-on: ubuntu-latest strategy: matrix: - python: ["3.8", "3.9", "3.10"] - netbox: ["3.3", "3.4", "3.5"] + python: ["3.8", "3.9", "3.10", "3.11"] + netbox: ["3.3", "3.4", "3.5", "3.6"] steps: - uses: actions/checkout@v2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/PKG-INFO new/pynetbox-7.2.0/PKG-INFO --- old/pynetbox-7.1.0/PKG-INFO 2023-08-25 23:32:21.930426100 +0200 +++ new/pynetbox-7.2.0/PKG-INFO 2023-09-07 17:42:53.921281800 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pynetbox -Version: 7.1.0 +Version: 7.2.0 Summary: NetBox API client library Home-page: https://github.com/netbox-community/pynetbox Author: Zach Moody @@ -13,4 +13,5 @@ Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 License-File: LICENSE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/pynetbox/core/app.py new/pynetbox-7.2.0/pynetbox/core/app.py --- old/pynetbox-7.1.0/pynetbox/core/app.py 2023-08-25 23:32:09.000000000 +0200 +++ new/pynetbox-7.2.0/pynetbox/core/app.py 2023-09-07 17:42:40.000000000 +0200 @@ -75,7 +75,7 @@ {'tables': {'DeviceTable': {'columns': ['name', 'status', 'tenant', - 'device_role', + 'role', 'site', 'primary_ip', 'tags']}}} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/pynetbox/core/endpoint.py new/pynetbox-7.2.0/pynetbox/core/endpoint.py --- old/pynetbox-7.1.0/pynetbox/core/endpoint.py 2023-08-25 23:32:09.000000000 +0200 +++ new/pynetbox-7.2.0/pynetbox/core/endpoint.py 2023-09-07 17:42:40.000000000 +0200 @@ -323,7 +323,7 @@ >>> device = netbox.dcim.devices.create( ... name='test', - ... device_role=1, + ... role=1, ... ) >>> @@ -344,14 +344,14 @@ >>> nb.dcim.devices.create([ ... { ... "name": "test1-core3", - ... "device_role": 3, + ... "role": 3, ... "site": 1, ... "device_type": 1, ... "status": 1 ... }, ... { ... "name": "test1-core4", - ... "device_role": 3, + ... "role": 3, ... "site": 1, ... "device_type": 1, ... "status": 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/pynetbox/core/query.py new/pynetbox-7.2.0/pynetbox/core/query.py --- old/pynetbox-7.1.0/pynetbox/core/query.py 2023-08-25 23:32:09.000000000 +0200 +++ new/pynetbox-7.2.0/pynetbox/core/query.py 2023-09-07 17:42:40.000000000 +0200 @@ -420,5 +420,5 @@ """ if not hasattr(self, "count"): - self.count = self._make_call(add_params={"limit": 1})["count"] + self.count = self._make_call(add_params={"limit": 1, "brief": 1})["count"] return self.count diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/pynetbox/core/response.py new/pynetbox-7.2.0/pynetbox/core/response.py --- old/pynetbox-7.1.0/pynetbox/core/response.py 2023-08-25 23:32:09.000000000 +0200 +++ new/pynetbox-7.2.0/pynetbox/core/response.py 2023-09-07 17:42:40.000000000 +0200 @@ -226,7 +226,7 @@ 'config_context': {}, 'created': '2018-04-01', 'custom_fields': {}, - 'device_role': {'id': 1, + 'role': {'id': 1, 'name': 'Test Switch', 'slug': 'test-switch', 'url': 'http://localhost:8000/api/dcim/device-roles/1/'}, @@ -413,6 +413,9 @@ if len(v) and isinstance(v[0], dict) and "object_type" in v[0]: v = [generic_list_parser(k, i) for i in v] to_cache = list(v) + elif k == "constraints": + # Permissions constraints can be either dict or list + to_cache = copy.deepcopy(v) else: v = [list_parser(k, i) for i in v] to_cache = list(v) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/pynetbox.egg-info/PKG-INFO new/pynetbox-7.2.0/pynetbox.egg-info/PKG-INFO --- old/pynetbox-7.1.0/pynetbox.egg-info/PKG-INFO 2023-08-25 23:32:21.000000000 +0200 +++ new/pynetbox-7.2.0/pynetbox.egg-info/PKG-INFO 2023-09-07 17:42:53.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pynetbox -Version: 7.1.0 +Version: 7.2.0 Summary: NetBox API client library Home-page: https://github.com/netbox-community/pynetbox Author: Zach Moody @@ -13,4 +13,5 @@ Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 License-File: LICENSE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/pynetbox.egg-info/SOURCES.txt new/pynetbox-7.2.0/pynetbox.egg-info/SOURCES.txt --- old/pynetbox-7.1.0/pynetbox.egg-info/SOURCES.txt 2023-08-25 23:32:21.000000000 +0200 +++ new/pynetbox-7.2.0/pynetbox.egg-info/SOURCES.txt 2023-09-07 17:42:53.000000000 +0200 @@ -5,6 +5,13 @@ requirements-dev.txt requirements.txt setup.py +.github/PULL_REQUEST_TEMPLATE.md +.github/ISSUE_TEMPLATE/bug_report.yaml +.github/ISSUE_TEMPLATE/config.yml +.github/ISSUE_TEMPLATE/deprecation.yaml +.github/ISSUE_TEMPLATE/documentation_change.yaml +.github/ISSUE_TEMPLATE/feature_request.yaml +.github/ISSUE_TEMPLATE/housekeeping.yaml .github/workflows/publish.yml .github/workflows/py3.yml docs/IPAM.rst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/setup.py new/pynetbox-7.2.0/setup.py --- old/pynetbox-7.1.0/setup.py 2023-08-25 23:32:09.000000000 +0200 +++ new/pynetbox-7.2.0/setup.py 2023-09-07 17:42:40.000000000 +0200 @@ -24,5 +24,6 @@ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ], ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/tests/conftest.py new/pynetbox-7.2.0/tests/conftest.py --- old/pynetbox-7.1.0/tests/conftest.py 2023-08-25 23:32:09.000000000 +0200 +++ new/pynetbox-7.2.0/tests/conftest.py 2023-09-07 17:42:40.000000000 +0200 @@ -4,7 +4,7 @@ from packaging import version -DEFAULT_NETBOX_VERSIONS = "3.3" +DEFAULT_NETBOX_VERSIONS = "3.6" def pytest_addoption(parser): @@ -39,7 +39,7 @@ action="store", help=( "Overrides the URL to run tests to. This allows for testing to the same" - " containers for seperate runs." + " containers for separate runs." ), ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/tests/fixtures/dcim/device.json new/pynetbox-7.2.0/tests/fixtures/dcim/device.json --- old/pynetbox-7.1.0/tests/fixtures/dcim/device.json 2023-08-25 23:32:09.000000000 +0200 +++ new/pynetbox-7.2.0/tests/fixtures/dcim/device.json 2023-09-07 17:42:40.000000000 +0200 @@ -14,7 +14,7 @@ "model": "MX960", "slug": "mx960" }, - "device_role": { + "role": { "id": 1, "url": "http://localhost:8000/api/dcim/device-roles/1/", "name": "Router", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/tests/fixtures/dcim/device_bulk_create.json new/pynetbox-7.2.0/tests/fixtures/dcim/device_bulk_create.json --- old/pynetbox-7.1.0/tests/fixtures/dcim/device_bulk_create.json 2023-08-25 23:32:09.000000000 +0200 +++ new/pynetbox-7.2.0/tests/fixtures/dcim/device_bulk_create.json 2023-09-07 17:42:40.000000000 +0200 @@ -3,7 +3,7 @@ "id": 1, "name": "test1-core3", "device_type": 1, - "device_role": 3, + "role": 3, "tenant": null, "platform": null, "serial": "", @@ -22,7 +22,7 @@ "id": 2, "name": "test1-core4", "device_type": 1, - "device_role": 3, + "role": 3, "tenant": null, "platform": null, "serial": "", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/tests/fixtures/dcim/devices.json new/pynetbox-7.2.0/tests/fixtures/dcim/devices.json --- old/pynetbox-7.1.0/tests/fixtures/dcim/devices.json 2023-08-25 23:32:09.000000000 +0200 +++ new/pynetbox-7.2.0/tests/fixtures/dcim/devices.json 2023-09-07 17:42:40.000000000 +0200 @@ -19,7 +19,7 @@ "model": "EX9214", "slug": "ex9214" }, - "device_role": { + "role": { "id": 3, "url": "http://localhost:8000/api/dcim/device-roles/3/", "name": "Core Switch", @@ -88,7 +88,7 @@ "model": "EX9214", "slug": "ex9214" }, - "device_role": { + "role": { "id": 3, "url": "http://localhost:8000/api/dcim/device-roles/3/", "name": "Core Switch", @@ -157,7 +157,7 @@ "model": "MX960", "slug": "mx960" }, - "device_role": { + "role": { "id": 1, "url": "http://localhost:8000/api/dcim/device-roles/1/", "name": "Router", @@ -226,7 +226,7 @@ "model": "MX960", "slug": "mx960" }, - "device_role": { + "role": { "id": 1, "url": "http://localhost:8000/api/dcim/device-roles/1/", "name": "Router", @@ -295,7 +295,7 @@ "model": "QFX5100-48S", "slug": "qfx5100-48s" }, - "device_role": { + "role": { "id": 4, "url": "http://localhost:8000/api/dcim/device-roles/4/", "name": "Leaf Switch", @@ -354,7 +354,7 @@ "model": "QFX5100-48S", "slug": "qfx5100-48s" }, - "device_role": { + "role": { "id": 4, "url": "http://localhost:8000/api/dcim/device-roles/4/", "name": "Leaf Switch", @@ -413,7 +413,7 @@ "model": "CM4148", "slug": "cm4148" }, - "device_role": { + "role": { "id": 5, "url": "http://localhost:8000/api/dcim/device-roles/5/", "name": "OOB Switch", @@ -472,7 +472,7 @@ "model": "CWG-24VYM415C9", "slug": "cwg-24vym415c9" }, - "device_role": { + "role": { "id": 6, "url": "http://localhost:8000/api/dcim/device-roles/6/", "name": "PDU", @@ -523,7 +523,7 @@ "model": "CWG-24VYM415C9", "slug": "cwg-24vym415c9" }, - "device_role": { + "role": { "id": 6, "url": "http://localhost:8000/api/dcim/device-roles/6/", "name": "PDU", @@ -574,7 +574,7 @@ "model": "QFX5100-24Q", "slug": "qfx5100-24q" }, - "device_role": { + "role": { "id": 2, "url": "http://localhost:8000/api/dcim/device-roles/2/", "name": "Spine Switch", @@ -633,7 +633,7 @@ "model": "QFX5100-24Q", "slug": "qfx5100-24q" }, - "device_role": { + "role": { "id": 2, "url": "http://localhost:8000/api/dcim/device-roles/2/", "name": "Spine Switch", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/tests/fixtures/users/permission.json new/pynetbox-7.2.0/tests/fixtures/users/permission.json --- old/pynetbox-7.1.0/tests/fixtures/users/permission.json 2023-08-25 23:32:09.000000000 +0200 +++ new/pynetbox-7.2.0/tests/fixtures/users/permission.json 2023-09-07 17:42:40.000000000 +0200 @@ -5,5 +5,13 @@ { "username": "user1" } + ], + "constraints": [ + { + "status": "active" + }, + { + "region__name": "Europe" + } ] } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/tests/integration/conftest.py new/pynetbox-7.2.0/tests/integration/conftest.py --- old/pynetbox-7.1.0/tests/integration/conftest.py 2023-08-25 23:32:09.000000000 +0200 +++ new/pynetbox-7.2.0/tests/integration/conftest.py 2023-09-07 17:42:40.000000000 +0200 @@ -33,6 +33,8 @@ tag = "2.5.3" elif (major, minor) == (3, 5): tag = "2.6.1" + elif (major, minor) == (3, 6): + tag = "2.7.0" else: raise NotImplementedError( "Version %s is not currently supported" % netbox_version @@ -479,14 +481,14 @@ @pytest.fixture(scope="session") -def device_role(api): - device_role = api.dcim.device_roles.create( +def role(api): + role = api.dcim.device_roles.create( name="test-device-role", slug="test-device-role", color="000000", ) - yield device_role - device_role.delete() + yield role + role.delete() def pytest_generate_tests(metafunc): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/tests/integration/test_dcim.py new/pynetbox-7.2.0/tests/integration/test_dcim.py --- old/pynetbox-7.1.0/tests/integration/test_dcim.py 2023-08-25 23:32:09.000000000 +0200 +++ new/pynetbox-7.2.0/tests/integration/test_dcim.py 2023-09-07 17:42:40.000000000 +0200 @@ -12,14 +12,23 @@ @pytest.fixture(scope="module") -def device(api, site, device_type, device_role): - device = api.dcim.devices.create( - name="test-device", - device_role=device_role.id, - device_type=device_type.id, - site=site.id, - color="000000", - ) +def device(api, site, device_type, role): + if version.parse(api.version) >= version.parse("3.6"): + device = api.dcim.devices.create( + name="test-device", + role=role.id, + device_type=device_type.id, + site=site.id, + color="000000", + ) + else: + device = api.dcim.devices.create( + name="test-device", + device_role=role.id, + device_type=device_type.id, + site=site.id, + color="000000", + ) yield device device.delete() @@ -188,13 +197,21 @@ class TestPowerCable(BaseTest): @pytest.fixture(scope="class") - def power_outlet(self, api, device_type, device_role, site): - pdu = api.dcim.devices.create( - name="test-pdu", - device_role=device_role.id, - device_type=device_type.id, - site=site.id, - ) + def power_outlet(self, api, device_type, role, site): + if version.parse(api.version) >= version.parse("3.6"): + pdu = api.dcim.devices.create( + name="test-pdu", + role=role.id, + device_type=device_type.id, + site=site.id, + ) + else: + pdu = api.dcim.devices.create( + name="test-pdu", + device_role=role.id, + device_type=device_type.id, + site=site.id, + ) outlet = api.dcim.power_outlets.create(name="outlet", device=pdu.id) yield outlet pdu.delete() @@ -230,13 +247,21 @@ class TestConsoleCable(BaseTest): @pytest.fixture(scope="class") - def console_server_port(self, api, device_type, device_role, site): - device = api.dcim.devices.create( - name="test-console-server", - device_role=device_role.id, - device_type=device_type.id, - site=site.id, - ) + def console_server_port(self, api, device_type, role, site): + if version.parse(api.version) >= version.parse("3.6"): + device = api.dcim.devices.create( + name="test-console-server", + role=role.id, + device_type=device_type.id, + site=site.id, + ) + else: + device = api.dcim.devices.create( + name="test-console-server", + device_role=role.id, + device_type=device_type.id, + site=site.id, + ) ret = api.dcim.console_server_ports.create(name="Port 1", device=device.id) yield ret device.delete() @@ -275,13 +300,21 @@ class TestInterfaceCable(BaseTest): @pytest.fixture(scope="class") - def interface_b(self, api, device_type, device_role, site): - device = api.dcim.devices.create( - name="test-device-2", - device_role=device_role.id, - device_type=device_type.id, - site=site.id, - ) + def interface_b(self, api, device_type, role, site): + if version.parse(api.version) >= version.parse("3.6"): + device = api.dcim.devices.create( + name="test-device-2", + role=role.id, + device_type=device_type.id, + site=site.id, + ) + else: + device = api.dcim.devices.create( + name="test-device-2", + device_role=role.id, + device_type=device_type.id, + site=site.id, + ) ret = api.dcim.interfaces.create( name="Ethernet1", type="1000base-t", device=device.id ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/tests/test_users.py new/pynetbox-7.2.0/tests/test_users.py --- old/pynetbox-7.1.0/tests/test_users.py 2023-08-25 23:32:09.000000000 +0200 +++ new/pynetbox-7.2.0/tests/test_users.py 2023-09-07 17:42:40.000000000 +0200 @@ -104,6 +104,15 @@ user = permission.users[0] self.assertEqual(str(user), "user1") + @patch( + "requests.sessions.Session.get", + return_value=Response(fixture="users/permission.json"), + ) + def test_constraints(self, _): + permission = nb.permissions.get(1) + self.assertIsInstance(permission.constraints, list) + self.assertIsInstance(permission.constraints[0], dict) + class UnknownModelTestCase(unittest.TestCase): """This test validates that an unknown model is returned as Record object diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynetbox-7.1.0/tests/unit/test_query.py new/pynetbox-7.2.0/tests/unit/test_query.py --- old/pynetbox-7.1.0/tests/unit/test_query.py 2023-08-25 23:32:09.000000000 +0200 +++ new/pynetbox-7.2.0/tests/unit/test_query.py 2023-09-07 17:42:40.000000000 +0200 @@ -17,17 +17,12 @@ "previous": False, "results": [], } - expected = call( - "http://localhost:8001/api/dcim/devices/", - params={"q": "abcd", "limit": 1}, - headers={"accept": "application/json"}, - ) test_obj.http_session.get.ok = True test = test_obj.get_count() self.assertEqual(test, 42) test_obj.http_session.get.assert_called_with( "http://localhost:8001/api/dcim/devices/", - params={"q": "abcd", "limit": 1}, + params={"q": "abcd", "limit": 1, "brief": 1}, headers={"accept": "application/json"}, json=None, ) @@ -48,7 +43,7 @@ self.assertEqual(test, 42) test_obj.http_session.get.assert_called_with( "http://localhost:8001/api/dcim/devices/", - params={"limit": 1}, + params={"limit": 1, "brief": 1}, headers={"accept": "application/json"}, json=None, )