Skip to content

Commit 3b3a4e4

Browse files
committed
Configure pylance and fix found issues
* provide None for possibly unbound vars * add extra path to make pylance work properly
1 parent e0efd95 commit 3b3a4e4

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"python.linting.enabled": true,
77
"restructuredtext.confPath": "${workspaceFolder}/docs",
88
"python.analysis.extraPaths": [
9-
"./tests/scripts"
9+
"./tests/scripts",
10+
"build/collections"
1011
]
1112
}

plugins/module_utils/phpipam_helper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ def _resolve_entity(self, key):
206206

207207
controller = entity_spec['controller'] or self.controller_uri
208208

209+
result = None
209210
if controller == 'subnets':
210211
subnet, mask = self.phpipam_params[key].split('/')
211212
result = self.find_subnet(subnet, mask)

plugins/modules/subnet.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ def main():
231231
if '/' not in module_params['cidr']:
232232
module.fail_json(msg='missing prefix lenght in "cidr". Need <ipaddr>/<prefix_lenght>.')
233233
else:
234+
IPNetwork = None
234235
if '.' in module_params['cidr'] and ':' not in module_params['cidr']:
235236
IPNetwork = ipaddress.IPv4Network
236237
module_params['mask'] = str(IPNetwork(u'%s' % (module_params['cidr'])).prefixlen)

0 commit comments

Comments
 (0)