Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
e60abb23
Commit
e60abb23
authored
1 year ago
by
JORGE SASIAIN
Browse files
Options
Downloads
Patches
Plain Diff
NAT-212
/213: try to fix lint-documentation
parent
cfe528c9
No related branches found
No related tags found
1 merge request
!52
Feature/nat 212 213
Pipeline
#83773
passed
1 year ago
Stage: tox
Stage: documentation
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/services/ipam.py
+11
-11
11 additions, 11 deletions
gso/services/ipam.py
with
11 additions
and
11 deletions
gso/services/ipam.py
+
11
−
11
View file @
e60abb23
...
...
@@ -46,8 +46,8 @@ REQUESTS_TIMEOUT = 20
# TODO: remove this!
# lab infoblox cert is
no
t valid for the ipv4 address
#
...
disable warnings for now
# lab infoblox cert is
n'
t valid for the ipv4 address
# disable warnings for now
requests
.
packages
.
urllib3
.
disable_warnings
()
...
...
@@ -299,11 +299,11 @@ def find_next_available_ip(infoblox_params, network_ref: str = ""):
Args:
----
infoblox_params (settings.InfoBloxParams): infoblox params
network_ref (str): the network to find the next available
ip
, in InfoBlox reference format
network_ref (str): the network to find the next available
IP
, in InfoBlox reference format
Returns:
-------
(str): next available
ip
in the network, or
"
NETWORK_FULL
"
if there
'
s no space in the network
(str): next available
IP
in the network, or
"
NETWORK_FULL
"
if there
'
s no space in the network
"""
r
=
requests
.
post
(
...
...
@@ -332,7 +332,7 @@ def allocate_host_inner( # noqa: C901
extattrs
:
Optional
[
dict
]
=
None
,
)
->
Union
[
HostAddresses
,
str
]:
# TODO: should hostnames be unique
# (
i.e.
fail if hostname already exists in this domain/service)?
# (fail if hostname already exists in this domain/service)?
if
cname_aliases
is
None
:
cname_aliases
=
[]
if
extattrs
is
None
:
...
...
@@ -342,7 +342,7 @@ def allocate_host_inner( # noqa: C901
assert
oss
.
IPAM
.
INFOBLOX
infoblox_params
=
oss
.
IPAM
.
INFOBLOX
# If networks is
no
t None, allocate host in those networks.
# If networks is
n'
t None, allocate host in those networks.
if
networks
:
ipv4_network
=
networks
[
0
]
ipv6_network
=
networks
[
1
]
...
...
@@ -370,7 +370,7 @@ def allocate_host_inner( # noqa: C901
if
ipv6_addr
==
"
NETWORK_FULL
"
:
return
"
IPV6_NETWORK_FULL
"
# Otherwise if addrs is
no
t None, allocate host with those addresses.
# Otherwise if addrs is
n'
t None, allocate host with those addresses.
else
:
ipv4_addr
=
addrs
[
0
]
ipv6_addr
=
addrs
[
1
]
...
...
@@ -432,7 +432,7 @@ def allocate_host( # noqa: C901
service_type (str): the name of the service type (e.g.
"
TRUNK
"
)
service_networks (ServiceNetworks, optional): ipv4 and ipv6 network to allocate host
host_addresses (HostAddresses, optional): ipv4 and ipv6 addresses to allocate host (service_networks has precedence)
cname_aliases (list, optional): to create
cname
records in addition to the host record
cname_aliases (list, optional): to create
CNAME
records in addition to the host record
extattrs (dict, optional): any extensible attributes to add in IPAM (e.g.
"
Site
"
: {
"
value
"
:
"
dummy
"
})
Returns:
...
...
@@ -570,7 +570,7 @@ def delete_network(
ip_version
=
ip_network_version
(
str
(
network
))
# Ensure that the network to be deleted is under the service type.
# Otherwise user is
no
t allowed to delete it
# Otherwise user is
n'
t allowed to delete it
oss_ipv4_containers
=
getattr
(
ipam_params
,
service_type
).
V4
.
containers
oss_ipv6_containers
=
getattr
(
ipam_params
,
service_type
).
V6
.
containers
oss_ipv4_networks
=
getattr
(
ipam_params
,
service_type
).
V4
.
networks
...
...
@@ -663,7 +663,7 @@ def delete_host(
assert
"
_ref
"
in
host_data
[
0
],
"
Host to delete does not exist in IPAM.
"
host_ref
=
host_data
[
0
][
"
_ref
"
]
# Find
cname
records reference
# Find
CNAME
records reference
r
=
requests
.
get
(
f
"
{
wapi
(
infoblox_params
)
}
/record:cname
"
,
params
=
{
...
...
@@ -768,7 +768,7 @@ def validate_host(
assert
len
(
host_data
)
==
1
,
"
Host to validate does not exist in IPAM.
"
assert
"
_ref
"
in
host_data
[
0
],
"
Host to validate does not exist in IPAM.
"
# Find
cname
records reference
# Find
CNAME
records reference
r
=
requests
.
get
(
f
"
{
wapi
(
infoblox_params
)
}
/record:cname
"
,
params
=
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment