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 2021-04-17 23:25:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pynetbox (Old)
and /work/SRC/openSUSE:Factory/.python-pynetbox.new.12324 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pynetbox"
Sat Apr 17 23:25:05 2021 rev:23 rq:886281 version:6.1.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pynetbox/python-pynetbox.changes
2021-04-10 15:29:00.934494085 +0200
+++
/work/SRC/openSUSE:Factory/.python-pynetbox.new.12324/python-pynetbox.changes
2021-04-17 23:25:10.069614778 +0200
@@ -1,0 +2,6 @@
+Fri Apr 16 12:09:56 UTC 2021 - Martin Hauke <[email protected]>
+
+- Update to version 6.1.2
+ * Fixes issue giving Endpoint.create() a list of dicts.
+
+-------------------------------------------------------------------
Old:
----
pynetbox-6.1.1.tar.gz
New:
----
pynetbox-6.1.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pynetbox.spec ++++++
--- /var/tmp/diff_new_pack.qxHbjF/_old 2021-04-17 23:25:10.481615481 +0200
+++ /var/tmp/diff_new_pack.qxHbjF/_new 2021-04-17 23:25:10.485615487 +0200
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pynetbox
-Version: 6.1.1
+Version: 6.1.2
Release: 0
Summary: NetBox API client library
License: Apache-2.0
++++++ pynetbox-6.1.1.tar.gz -> pynetbox-6.1.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pynetbox-6.1.1/PKG-INFO new/pynetbox-6.1.2/PKG-INFO
--- old/pynetbox-6.1.1/PKG-INFO 2021-04-09 02:16:52.918451800 +0200
+++ new/pynetbox-6.1.2/PKG-INFO 2021-04-15 18:10:46.311832200 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pynetbox
-Version: 6.1.1
+Version: 6.1.2
Summary: NetBox API client library
Home-page: https://github.com/digitalocean/pynetbox
Author: Zach Moody
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pynetbox-6.1.1/README.md new/pynetbox-6.1.2/README.md
--- old/pynetbox-6.1.1/README.md 2021-04-09 02:16:40.000000000 +0200
+++ new/pynetbox-6.1.2/README.md 2021-04-15 18:10:35.000000000 +0200
@@ -29,11 +29,17 @@
## Queries
-The pynetbox API is setup so that NetBox's apps are attributes of the `.api()`
object, and in turn those apps have attribute representing each endpoint. Each
endpoint has a handful of verbs available to carry out actions on the endpoint.
For example, in order to query all the objects in the devices endpoint you
would do the following:
+The pynetbox API is setup so that NetBox's apps are attributes of the `.api()`
object, and in turn those apps have attribute representing each endpoint. Each
endpoint has a handful of methods available to carry out actions on the
endpoint. For example, in order to query all the objects in the `devices`
endpoint you would do the following:
```
-nb.dcim.devices.all()
-[test1-leaf1, test1-leaf2]
+>>> devices = nb.dcim.devices.all()
+>>> for device in devices:
+... print(device.name)
+...
+test1-leaf1
+test1-leaf2
+test1-leaf3
+>>>
```
### Threading
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pynetbox-6.1.1/docs/response.rst
new/pynetbox-6.1.2/docs/response.rst
--- old/pynetbox-6.1.1/docs/response.rst 2021-04-09 02:16:40.000000000
+0200
+++ new/pynetbox-6.1.2/docs/response.rst 2021-04-15 18:10:35.000000000
+0200
@@ -2,4 +2,7 @@
========
.. autoclass:: pynetbox.core.response.Record
- :members:
\ No newline at end of file
+ :members:
+
+.. autoclass:: pynetbox.core.response.RecordSet
+ :members:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pynetbox-6.1.1/pynetbox/core/endpoint.py
new/pynetbox-6.1.2/pynetbox/core/endpoint.py
--- old/pynetbox-6.1.1/pynetbox/core/endpoint.py 2021-04-09
02:16:40.000000000 +0200
+++ new/pynetbox-6.1.2/pynetbox/core/endpoint.py 2021-04-15
18:10:35.000000000 +0200
@@ -79,12 +79,17 @@
:arg int,optional limit: Overrides the max page size on
paginated returns.
- :Returns: List of :py:class:`.Record` objects.
+ :Returns: A :py:class:`.RecordSet` object.
:Examples:
- >>> nb.dcim.devices.all()
- [test1-a3-oobsw2, test1-a3-oobsw3, test1-a3-oobsw4]
+ >>> devices = nb.dcim.devices.all()
+ >>> for device in devices:
+ ... print(device.name)
+ ...
+ test1-leaf1
+ test1-leaf2
+ test1-leaf3
>>>
"""
req = Request(
@@ -176,33 +181,50 @@
:arg int,optional limit: Overrides the max page size on
paginated returns.
- :Returns: A list of :py:class:`.Record` objects.
+ :Returns: A :py:class:`.RecordSet` object.
:Examples:
To return a list of objects matching a named argument filter.
- >>> nb.dcim.devices.filter(role='leaf-switch')
- [test1-a3-tor1b, test1-a3-tor1c, test1-a3-tor1d, test1-a3-tor2a]
+ >>> devices = nb.dcim.devices.filter(role='leaf-switch')
+ >>> for device in devices:
+ ... print(device.name)
+ ...
+ test1-leaf1
+ test1-leaf2
+ test1-leaf3
>>>
Using a freeform query along with a named argument.
- >>> nb.dcim.devices.filter('a3', role='leaf-switch')
- [test1-a3-tor1b, test1-a3-tor1c, test1-a3-tor1d, test1-a3-tor2a]
+ >>> devices = nb.dcim.devices.filter('a3', role='leaf-switch')
+ >>> for device in devices:
+ ... print(device.name)
+ ...
+ test1-a3-leaf1
+ test1-a3-leaf2
>>>
Chaining multiple named arguments.
- >>> nb.dcim.devices.filter(role='leaf-switch', status=True)
- [test1-leaf2]
+ >>> devices = nb.dcim.devices.filter(role='leaf-switch', status=True)
+ >>> for device in devices:
+ ... print(device.name)
+ ...
+ test1-leaf2
>>>
Passing a list as a named argument adds multiple filters of the
same value.
- >>> nb.dcim.devices.filter(role=['leaf-switch', 'spine-switch'])
- [test1-a3-spine1, test1-a3-spine2, test1-a3-leaf1]
+ >>> device = nb.dcim.devices.filter(role=['leaf-switch',
'spine-switch'])
+ >>> for device in devices:
+ ... print(device.name)
+ ...
+ test1-a3-spine1
+ test1-a3-spine2
+ test1-a3-leaf1
>>>
"""
@@ -251,10 +273,9 @@
:Examples:
- Creating an object on the `devices` endpoint you can lookup a
- device_role's name with:
+ Creating an object on the `devices` endpoint:
- >>> netbox.dcim.devices.create(
+ >>> device = netbox.dcim.devices.create(
... name='test',
... device_role=1,
... )
@@ -287,6 +308,8 @@
http_session=self.api.http_session,
).post(args[0] if args else kwargs)
+ if isinstance(req, list):
+ return [self.return_obj(i, self.api, self) for i in req]
return self.return_obj(req, self.api, self)
def choices(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pynetbox-6.1.1/pynetbox/core/response.py
new/pynetbox-6.1.2/pynetbox/core/response.py
--- old/pynetbox-6.1.1/pynetbox/core/response.py 2021-04-09
02:16:40.000000000 +0200
+++ new/pynetbox-6.1.2/pynetbox/core/response.py 2021-04-15
18:10:35.000000000 +0200
@@ -71,6 +71,34 @@
class RecordSet(object):
+ """Iterator containing Record objects.
+
+ Returned by :py:meth:`.Endpoint.all()` and :py:meth:`.Endpoint.filter()`
methods.
+ Allows iteration of and actions to be taken on the results from the
aforementioned
+ methods. Contains :py:class:`.Record` objects.
+
+ :Examples:
+
+ To see how many results are in a query by calling ``len()``.
+
+ >>> x = nb.dcim.devices.all()
+ >>> len(x)
+ 123
+ >>>
+
+ Simple iteration of the results.
+
+ >>> devices = nb.dcim.devices.all()
+ >>> for device in devices:
+ ... print(device.name)
+ ...
+ test1-leaf1
+ test1-leaf2
+ test1-leaf3
+ >>>
+
+ """
+
def __init__(self, endpoint, request, **kwargs):
self.endpoint = endpoint
self.request = request
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pynetbox-6.1.1/pynetbox.egg-info/PKG-INFO
new/pynetbox-6.1.2/pynetbox.egg-info/PKG-INFO
--- old/pynetbox-6.1.1/pynetbox.egg-info/PKG-INFO 2021-04-09
02:16:52.000000000 +0200
+++ new/pynetbox-6.1.2/pynetbox.egg-info/PKG-INFO 2021-04-15
18:10:46.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pynetbox
-Version: 6.1.1
+Version: 6.1.2
Summary: NetBox API client library
Home-page: https://github.com/digitalocean/pynetbox
Author: Zach Moody
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pynetbox-6.1.1/tests/integration/test_dcim.py
new/pynetbox-6.1.2/tests/integration/test_dcim.py
--- old/pynetbox-6.1.1/tests/integration/test_dcim.py 2021-04-09
02:16:40.000000000 +0200
+++ new/pynetbox-6.1.2/tests/integration/test_dcim.py 2021-04-15
18:10:35.000000000 +0200
@@ -90,10 +90,12 @@
@pytest.fixture(scope="class")
def add_sites(self, api):
- sites = [
- api.dcim.sites.create(name="test{}".format(i),
slug="test{}".format(i))
- for i in range(2, 20)
- ]
+ sites = api.dcim.sites.create(
+ [
+ {"name": "test{}".format(i), "slug": "test{}".format(i)}
+ for i in range(2, 20)
+ ]
+ )
yield
for i in sites:
i.delete()