Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inventory-provider
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
dashboardv3
inventory-provider
Commits
d7e26ba9
Commit
d7e26ba9
authored
5 years ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
update task messages in case of failure
parent
09649bea
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
inventory_provider/tasks/worker.py
+21
-12
21 additions, 12 deletions
inventory_provider/tasks/worker.py
with
21 additions
and
12 deletions
inventory_provider/tasks/worker.py
+
21
−
12
View file @
d7e26ba9
...
...
@@ -60,9 +60,18 @@ class InventoryTask(Task):
))
super
().
update_state
(
**
kwargs
)
def
on_failure
(
self
,
exc
,
task_id
,
args
,
kwargs
,
einfo
):
self
.
update_state
(
state
=
states
.
FAILURE
,
meta
=
{
'
task
'
:
task_id
,
'
message
'
:
str
(
exc
)
})
super
().
on_failure
(
exc
,
task_id
,
args
,
kwargs
,
einfo
)
@app.task
def
snmp_refresh_interfaces
(
hostname
,
community
):
@app.task
(
base
=
InventoryTask
,
bind
=
True
)
def
snmp_refresh_interfaces
(
self
,
hostname
,
community
):
logger
=
logging
.
getLogger
(
__name__
)
logger
.
debug
(
'
>>> snmp_refresh_interfaces(%r, %r)
'
%
(
hostname
,
community
))
...
...
@@ -76,8 +85,8 @@ def snmp_refresh_interfaces(hostname, community):
'
<<< snmp_refresh_interfaces(%r, %r)
'
%
(
hostname
,
community
))
@app.task
def
netconf_refresh_config
(
hostname
):
@app.task
(
base
=
InventoryTask
,
bind
=
True
)
def
netconf_refresh_config
(
self
,
hostname
):
logger
=
logging
.
getLogger
(
__name__
)
logger
.
debug
(
'
>>> netconf_refresh_config(%r)
'
%
hostname
)
...
...
@@ -90,8 +99,8 @@ def netconf_refresh_config(hostname):
logger
.
debug
(
'
<<< netconf_refresh_config(%r)
'
%
hostname
)
@app.task
def
update_interfaces_to_services
():
@app.task
(
base
=
InventoryTask
,
bind
=
True
)
def
update_interfaces_to_services
(
self
):
logger
=
logging
.
getLogger
(
__name__
)
logger
.
debug
(
'
>>> update_interfaces_to_services
'
)
...
...
@@ -115,8 +124,8 @@ def update_interfaces_to_services():
logger
.
debug
(
'
<<< update_interfaces_to_services
'
)
@app.task
def
update_equipment_locations
():
@app.task
(
base
=
InventoryTask
,
bind
=
True
)
def
update_equipment_locations
(
self
):
logger
=
logging
.
getLogger
(
__name__
)
logger
.
debug
(
'
>>> update_equipment_locations
'
)
...
...
@@ -134,8 +143,8 @@ def update_equipment_locations():
logger
.
debug
(
'
<<< update_equipment_locations
'
)
@app.task
def
update_circuit_hierarchy
():
@app.task
(
base
=
InventoryTask
,
bind
=
True
)
def
update_circuit_hierarchy
(
self
):
logger
=
logging
.
getLogger
(
__name__
)
logger
.
debug
(
'
>>> update_circuit_hierarchy
'
)
...
...
@@ -165,8 +174,8 @@ def update_circuit_hierarchy():
logger
.
debug
(
'
<<< update_circuit_hierarchy
'
)
@app.task
def
update_geant_lambdas
():
@app.task
(
base
=
InventoryTask
,
bind
=
True
)
def
update_geant_lambdas
(
self
):
logger
=
logging
.
getLogger
(
__name__
)
logger
.
debug
(
'
>>> update_geant_lambdas
'
)
...
...
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