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
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
a448945a
Verified
Commit
a448945a
authored
7 months ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
Add public hostname and environment to general OSS params
parent
af334eed
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!245
Feature/distinguish public private hostname
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gso/__init__.py
+2
-2
2 additions, 2 deletions
gso/__init__.py
gso/oss-params-example.json
+4
-3
4 additions, 3 deletions
gso/oss-params-example.json
gso/settings.py
+13
-12
13 additions, 12 deletions
gso/settings.py
with
19 additions
and
17 deletions
gso/__init__.py
+
2
−
2
View file @
a448945a
...
...
@@ -47,8 +47,8 @@ def init_cli_app() -> typer.Typer:
def
init_sentry
()
->
None
:
"""
Only initialize Sentry if not in testing mode.
"""
if
os
.
getenv
(
"
TESTING
"
,
"
false
"
).
lower
()
==
"
false
"
and
(
sentry_config
:
=
load_oss_params
()
.
SENTRY
):
sentry_sdk
.
init
(
dsn
=
sentry_config
.
DSN
,
environment
=
sentry_config
.
environment
,
traces_sample_rate
=
1.0
)
if
os
.
getenv
(
"
TESTING
"
,
"
false
"
).
lower
()
==
"
false
"
and
(
oss_params
:
=
load_oss_params
()):
sentry_sdk
.
init
(
dsn
=
oss_params
.
SENTRY
.
DSN
,
environment
=
oss_params
.
GENERAL
.
environment
,
traces_sample_rate
=
1.0
)
init_sentry
()
This diff is collapsed.
Click to expand it.
gso/oss-params-example.json
+
4
−
3
View file @
a448945a
{
"GENERAL"
:
{
"public_hostname"
:
"https://gap.geant.org"
,
"isis_high_metric"
:
999999
"internal_hostname"
:
"http://gso-api:9000"
,
"isis_high_metric"
:
999999
,
"environment"
:
"development"
},
"NETBOX"
:
{
"api"
:
"https://127.0.0.1:8000"
,
...
...
@@ -119,7 +121,6 @@
"md5_password"
:
"snmp password"
},
"SENTRY"
:
{
"DSN"
:
"https://sentry-dsn-url"
,
"environment"
:
"development"
"DSN"
:
"https://sentry-dsn-url"
}
}
This diff is collapsed.
Click to expand it.
gso/settings.py
+
13
−
12
View file @
a448945a
...
...
@@ -21,13 +21,24 @@ from gso.utils.shared_enums import PortNumber
logger
=
logging
.
getLogger
(
__name__
)
class
EnvironmentEnum
(
strEnum
):
"""
The different environments in which the GSO system can run.
"""
DEVELOPMENT
=
"
development
"
TEST
=
"
test
"
UAT
=
"
uat
"
PRODUCTION
=
"
production
"
class
GeneralParams
(
BaseSettings
):
"""
General parameters for a :term:`GSO` configuration file.
"""
public_hostname
:
str
"""
The hostname that :term:`GSO` is publicly served at, used for building the callback URL that the provisioning
proxy uses.
"""
"""
The hostname that :term:`GSO` is publicly served at, used for building callback URLs for public use.
"""
internal_hostname
:
str
"""
The hostname of :term:`GSO` that is for internal use, such as the provisioning proxy.
"""
isis_high_metric
:
int
environment
:
EnvironmentEnum
class
CeleryParams
(
BaseSettings
):
...
...
@@ -192,20 +203,10 @@ class KentikParams(BaseSettings):
md5_password
:
str
class
EnvironmentEnum
(
strEnum
):
"""
The different environments in which the GSO system can run.
"""
DEVELOPMENT
=
"
development
"
TEST
=
"
test
"
UAT
=
"
uat
"
PRODUCTION
=
"
production
"
class
SentryParams
(
BaseSettings
):
"""
Settings for Sentry.
"""
DSN
:
str
environment
:
EnvironmentEnum
class
OSSParams
(
BaseSettings
):
...
...
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