Skip to content

Commit c6dd432

Browse files
Fix Ansible 2.10 sanity tests (#344)
1 parent b33e79c commit c6dd432

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+170
-31
lines changed

docs/_extensions/pygments_lexer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ def __init__(self, **options):
219219

220220

221221
def setup(app):
222-
""" Initializer for Sphinx extension API.
223-
See http://www.sphinx-doc.org/en/stable/extdev/index.html#dev-extensions.
222+
"""Initializer for Sphinx extension API.
223+
See http://www.sphinx-doc.org/en/stable/extdev/index.html#dev-extensions.
224224
"""
225225
for lexer in [AnsibleOutputLexer(startinline=True)]:
226226
app.add_lexer(lexer.name, lexer)

plugins/inventory/nb_inventory.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ def _fetch_information(self, url):
274274
)
275275
except urllib_error.HTTPError as e:
276276
"""This will return the response body when we encounter an error.
277-
This is to help determine what might be the issue when encountering an error.
278-
Please check issue #294 for more info.
277+
This is to help determine what might be the issue when encountering an error.
278+
Please check issue #294 for more info.
279279
"""
280280
raise AnsibleError(to_native(e.fp.read()))
281281

@@ -299,8 +299,8 @@ def _fetch_information(self, url):
299299

300300
def get_resource_list(self, api_url):
301301
"""Retrieves resource list from netbox API.
302-
Returns:
303-
A list of all resource from netbox API.
302+
Returns:
303+
A list of all resource from netbox API.
304304
"""
305305
if not api_url:
306306
raise AnsibleError("Please check API URL in script configuration file.")
@@ -938,10 +938,12 @@ def refresh_ipaddresses(self):
938938
# We need to copy the ipaddress entry to preserve the original in case caching is used.
939939
ipaddress_copy = ipaddress.copy()
940940

941-
if ipaddress["assigned_object_type"] == 'virtualization.vminterface':
941+
if ipaddress["assigned_object_type"] == "virtualization.vminterface":
942942
self.vm_ipaddresses_lookup[interface_id][ip_id] = ipaddress_copy
943943
else:
944-
self.device_ipaddresses_lookup[interface_id][ip_id] = ipaddress_copy # Remove "assigned_object_X" attributes, as that's redundant when ipaddress is added to an interface
944+
self.device_ipaddresses_lookup[interface_id][
945+
ip_id
946+
] = ipaddress_copy # Remove "assigned_object_X" attributes, as that's redundant when ipaddress is added to an interface
945947

946948
del ipaddress_copy["assigned_object_id"]
947949
del ipaddress_copy["assigned_object_type"]

plugins/module_utils/netbox_ipam.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ def _handle_state_new_present(self, nb_app, nb_endpoint, endpoint_name, name, da
5353
def _ensure_ip_in_prefix_present_on_netif(
5454
self, nb_app, nb_endpoint, data, endpoint_name
5555
):
56-
"""
57-
"""
56+
""""""
5857
if not data.get("interface") or not data.get("prefix"):
5958
self._handle_errors("A prefix and interface are required")
6059

plugins/module_utils/netbox_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@
412412
netbox_url=dict(type="str", required=True),
413413
netbox_token=dict(type="str", required=True, no_log=True),
414414
state=dict(required=False, default="present", choices=["present", "absent"]),
415-
query_params=dict(required=False, type="list"),
415+
query_params=dict(required=False, type="list", elements="str"),
416416
validate_certs=dict(type="raw", default=True),
417417
)
418418

plugins/modules/netbox_aggregate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
rir:
5252
description:
5353
- "The RIR the aggregate will be assigned to"
54-
required: true
54+
required: false
5555
type: raw
5656
date_added:
5757
description:
@@ -87,6 +87,7 @@
8787
- an object unique in their environment.
8888
required: false
8989
type: list
90+
elements: str
9091
validate_certs:
9192
description:
9293
- "If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates."

plugins/modules/netbox_cable.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
- an object unique in their environment.
159159
required: false
160160
type: list
161+
elements: str
161162
validate_certs:
162163
description:
163164
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_circuit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
provider:
5353
description:
5454
- The provider of the circuit
55-
required: true
55+
required: false
5656
type: raw
5757
circuit_type:
5858
description:
@@ -112,6 +112,7 @@
112112
- an object unique in their environment.
113113
required: false
114114
type: list
115+
elements: str
115116
validate_certs:
116117
description:
117118
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_circuit_termination.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
- an object unique in their environment.
101101
required: false
102102
type: list
103+
elements: str
103104
validate_certs:
104105
description:
105106
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_circuit_type.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
- an object unique in their environment.
6969
required: false
7070
type: list
71+
elements: str
7172
validate_certs:
7273
description:
7374
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_cluster.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
cluster_type:
5353
description:
5454
- type of the cluster
55-
required: true
55+
required: false
5656
type: raw
5757
cluster_group:
5858
description:
@@ -97,6 +97,7 @@
9797
- an object unique in their environment.
9898
required: false
9999
type: list
100+
elements: str
100101
validate_certs:
101102
description:
102103
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_cluster_group.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
- an object unique in their environment.
6969
required: false
7070
type: list
71+
elements: str
7172
validate_certs:
7273
description:
7374
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_cluster_type.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
- an object unique in their environment.
6969
required: false
7070
type: list
71+
elements: str
7172
validate_certs:
7273
description:
7374
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_console_port.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
- an object unique in their environment.
9898
required: false
9999
type: list
100+
elements: str
100101
validate_certs:
101102
description:
102103
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_console_port_template.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
- an object unique in their environment.
8888
required: false
8989
type: list
90+
elements: str
9091
validate_certs:
9192
description:
9293
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_console_server_port.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
- an object unique in their environment.
9898
required: false
9999
type: list
100+
elements: str
100101
validate_certs:
101102
description:
102103
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_console_server_port_template.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
- an object unique in their environment.
8888
required: false
8989
type: list
90+
elements: str
9091
validate_certs:
9192
description:
9293
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_device.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
- David Gomez (@amb1s1)
2929
requirements:
3030
- pynetbox
31-
version_added: '2.8'
31+
version_added: '0.1.0'
3232
options:
3333
netbox_url:
3434
description:
@@ -174,6 +174,7 @@
174174
- an object unique in their environment.
175175
required: false
176176
type: list
177+
elements: str
177178
validate_certs:
178179
description:
179180
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_device_bay.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
device:
4646
description:
4747
- The device the device bay will be associated to. The device type must be "parent".
48-
required: true
48+
required: false
4949
type: raw
5050
name:
5151
description:
@@ -82,6 +82,7 @@
8282
- an object unique in their environment.
8383
required: false
8484
type: list
85+
elements: str
8586
validate_certs:
8687
description:
8788
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_device_bay_template.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
- an object unique in their environment.
6969
required: false
7070
type: list
71+
elements: str
7172
validate_certs:
7273
description:
7374
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_device_interface.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
- Mikhail Yohman (@FragmentedPacket)
2828
requirements:
2929
- pynetbox
30-
version_added: "2.8"
30+
version_added: "0.1.0"
3131
options:
3232
netbox_url:
3333
description:
@@ -46,7 +46,7 @@
4646
device:
4747
description:
4848
- Name of the device the interface will be associated with (case-sensitive)
49-
required: true
49+
required: false
5050
type: raw
5151
name:
5252
description:
@@ -141,6 +141,7 @@
141141
- an object unique in their environment.
142142
required: false
143143
type: list
144+
elements: str
144145
validate_certs:
145146
description:
146147
- |

plugins/modules/netbox_device_interface_template.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
- an object unique in their environment.
8282
required: false
8383
type: list
84+
elements: str
8485
validate_certs:
8586
description:
8687
- |

plugins/modules/netbox_device_role.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
color:
5151
description:
5252
- Hexidecimal code for a color, ex. FFFFFF
53-
required: true
53+
required: false
5454
type: str
5555
slug:
5656
description:
@@ -77,6 +77,7 @@
7777
- an object unique in their environment.
7878
required: false
7979
type: list
80+
elements: str
8081
validate_certs:
8182
description:
8283
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_device_type.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
manufacturer:
4646
description:
4747
- The manufacturer of the device type
48-
required: true
48+
required: false
4949
type: raw
5050
model:
5151
description:
@@ -114,6 +114,7 @@
114114
- an object unique in their environment.
115115
required: false
116116
type: list
117+
elements: str
117118
validate_certs:
118119
description:
119120
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_front_port.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
- an object unique in their environment.
109109
required: false
110110
type: list
111+
elements: str
111112
validate_certs:
112113
description:
113114
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_front_port_template.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
- sc
7474
- sc-apc
7575
- st
76-
required: true
76+
required: false
7777
type: str
7878
rear_port_template:
7979
description:
@@ -98,6 +98,7 @@
9898
- an object unique in their environment.
9999
required: false
100100
type: list
101+
elements: str
101102
validate_certs:
102103
description:
103104
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_interface.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
ANSIBLE_METADATA = {
1212
"metadata_version": "1.1",
13-
"status": ["preview"],
13+
"status": ["deprecated"],
1414
"supported_by": "community",
1515
}
1616

@@ -28,6 +28,10 @@
2828
requirements:
2929
- pynetbox
3030
version_added: "2.8"
31+
deprecated:
32+
removed_in: 0.1.0
33+
alternative: Use M(netbox_device_interface) or M(netbox_vm_interface) instead.
34+
why: Moved to new modular structure for managing the modules.
3135
options:
3236
netbox_url:
3337
description:

plugins/modules/netbox_inventory_item.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
device:
4747
description:
4848
- Name of the device the inventory item belongs to
49-
required: true
49+
required: false
5050
type: raw
5151
name:
5252
description:
@@ -102,6 +102,7 @@
102102
- an object unique in their environment.
103103
required: false
104104
type: list
105+
elements: str
105106
validate_certs:
106107
description:
107108
- |

plugins/modules/netbox_ip_address.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
- Anthony Ruhier (@Anthony25)
2929
requirements:
3030
- pynetbox
31-
version_added: '2.8'
31+
version_added: '0.1.0'
3232
options:
3333
netbox_url:
3434
description:
@@ -151,6 +151,7 @@
151151
- an object unique in their environment.
152152
required: false
153153
type: list
154+
elements: str
154155
validate_certs:
155156
description:
156157
- If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

plugins/modules/netbox_ipam_role.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
- an object unique in their environment.
7474
required: false
7575
type: list
76+
elements: str
7677
validate_certs:
7778
description:
7879
- |

0 commit comments

Comments
 (0)