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
9fb7a7ae
Commit
9fb7a7ae
authored
2 years ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
use ipaddress.*Network types
parent
2cff272b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
geant_service_orchestrator/settings.py
+15
-6
15 additions, 6 deletions
geant_service_orchestrator/settings.py
with
15 additions
and
6 deletions
geant_service_orchestrator/settings.py
+
15
−
6
View file @
9fb7a7ae
import
ipaddress
import
json
import
os
from
typing
import
Optional
from
pydantic
import
BaseSettings
...
...
@@ -12,14 +12,19 @@ class InfoBloxParams(BaseSettings):
password
:
str
class
ServiceNetworkProtocolParams
(
BaseSettings
):
container
:
str
# ipaddress?
mask
:
int
class
V4NetworkParams
(
BaseSettings
):
container
:
ipaddress
.
IPv4Network
mask
:
int
# TODO: validation on mask?
class
V6NetworkParams
(
BaseSettings
):
container
:
ipaddress
.
IPv6Network
mask
:
int
# TODO: validation on mask?
class
ServiceNetworkParams
(
BaseSettings
):
V4
:
ServiceNetworkProtocol
Params
V6
:
ServiceNetworkProtocol
Params
V4
:
V4Network
Params
V6
:
V6Network
Params
class
IPAMParams
(
BaseSettings
):
...
...
@@ -34,6 +39,10 @@ class OSSParams(BaseSettings):
def
load_oss_params
()
->
OSSParams
:
"""
look for OSS_PARAMS_FILENAME in the environment and load the
parameters from that file
"""
with
open
(
os
.
environ
[
'
OSS_PARAMS_FILENAME
'
])
as
f
:
return
OSSParams
(
**
json
.
loads
(
f
.
read
()))
...
...
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