Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
brian-dashboard-manager
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
geant-swd
brian
brian-dashboard-manager
Commits
76b70ca7
Commit
76b70ca7
authored
5 months ago
by
Bjarke Madsen
Browse files
Options
Downloads
Patches
Plain Diff
add timeouts and logging on previously hidden errors
parent
814c85ec
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
brian_dashboard_manager/grafana/provision.py
+13
-4
13 additions, 4 deletions
brian_dashboard_manager/grafana/provision.py
brian_dashboard_manager/inventory_provider/interfaces.py
+5
-5
5 additions, 5 deletions
brian_dashboard_manager/inventory_provider/interfaces.py
with
18 additions
and
9 deletions
brian_dashboard_manager/grafana/provision.py
+
13
−
4
View file @
76b70ca7
...
...
@@ -942,7 +942,12 @@ def provision(config):
"""
start
=
time
.
time
()
all_orgs
=
_provision_orgs
(
config
)
try
:
all_orgs
=
_provision_orgs
(
config
)
except
Exception
:
logger
.
exception
(
'
Error when provisioning orgs
'
)
return
request
=
AdminRequest
(
**
config
)
try
:
# needed for older versions of grafana (<11.0)
...
...
@@ -961,9 +966,13 @@ def provision(config):
return
None
orgs
=
list
(
filter
(
lambda
t
:
t
[
1
]
is
not
None
,
[(
org
,
_find_org_config
(
org
))
for
org
in
all_orgs
]))
interfaces
=
get_interfaces
(
config
[
'
inventory_provider
'
])
services
=
fetch_services
(
config
[
'
reporting_provider
'
])
regions
=
get_nren_regions
(
config
[
'
inventory_provider
'
])
try
:
interfaces
=
get_interfaces
(
config
[
'
inventory_provider
'
])
services
=
fetch_services
(
config
[
'
reporting_provider
'
])
regions
=
get_nren_regions
(
config
[
'
inventory_provider
'
])
except
Exception
:
logger
.
exception
(
'
Error when fetching interfaces:
'
)
return
for
org
,
org_config
in
orgs
:
_provision_org
(
config
,
org
,
org_config
,
interfaces
,
services
,
regions
)
...
...
This diff is collapsed.
Click to expand it.
brian_dashboard_manager/inventory_provider/interfaces.py
+
5
−
5
View file @
76b70ca7
...
...
@@ -322,7 +322,7 @@ def _get_ip_info(host):
return
prev
try
:
r
=
requests
.
get
(
f
'
{
host
}
/data/interfaces
'
)
r
=
requests
.
get
(
f
'
{
host
}
/data/interfaces
'
,
timeout
=
5
)
r
.
raise_for_status
()
interfaces
=
r
.
json
()
except
HTTPError
:
...
...
@@ -341,7 +341,7 @@ def get_interfaces(host):
:return: A list of interfaces with IP information added, if present.
"""
r
=
requests
.
get
(
f
'
{
host
}
/poller/interfaces
'
)
r
=
requests
.
get
(
f
'
{
host
}
/poller/interfaces
'
,
timeout
=
5
)
try
:
r
.
raise_for_status
()
interfaces
=
r
.
json
()
...
...
@@ -415,7 +415,7 @@ def get_gws_direct(host):
:return: GWS direct data
"""
r
=
requests
.
get
(
f
'
{
host
}
/poller/gws/direct
'
)
r
=
requests
.
get
(
f
'
{
host
}
/poller/gws/direct
'
,
timeout
=
5
)
try
:
r
.
raise_for_status
()
interfaces
=
r
.
json
()
...
...
@@ -435,7 +435,7 @@ def get_gws_indirect(host):
:return: GWS Indirect data
"""
try
:
r
=
requests
.
get
(
f
'
{
host
}
/poller/gws/indirect
'
)
r
=
requests
.
get
(
f
'
{
host
}
/poller/gws/indirect
'
,
timeout
=
5
)
r
.
raise_for_status
()
interfaces
=
r
.
json
()
except
HTTPError
:
...
...
@@ -452,7 +452,7 @@ def get_eumetsat_multicast_subscriptions(host):
:return: EUMETSAT multicast subscriptions
"""
try
:
r
=
requests
.
get
(
f
'
{
host
}
/poller/eumetsat-multicast
'
)
r
=
requests
.
get
(
f
'
{
host
}
/poller/eumetsat-multicast
'
,
timeout
=
5
)
r
.
raise_for_status
()
data
=
r
.
json
()
except
HTTPError
:
...
...
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