Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
csentry
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
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
Code review analytics
Issue 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
Anders Harrisson
csentry
Commits
8d737f58
Commit
8d737f58
authored
6 years ago
by
Benjamin Bertrand
Browse files
Options
Downloads
Patches
Plain Diff
Removed unused update_inventory function
launch_awx_job function was updated to trigger an inventory update.
parent
540732dc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/tasks.py
+0
-23
0 additions, 23 deletions
app/tasks.py
with
0 additions
and
23 deletions
app/tasks.py
+
0
−
23
View file @
8d737f58
...
...
@@ -197,29 +197,6 @@ def launch_awx_job(resource="job", **kwargs):
return
result
def
update_inventory
(
inventory_source
,
**
kwargs
):
"""
Update an inventory source in AWX
:param inventory_source: name or id of the inventory source to be updated
:param **kwargs: keyword arguments passed to update the inventory
:returns: A dictionary with information from resource.monitor
"""
rq_job
=
get_current_job
()
if
not
current_app
.
config
.
get
(
"
AWX_JOB_ENABLED
"
,
False
):
current_app
.
logger
.
info
(
"
AWX job is disabled. Not sending any request.
"
)
return
"
AWX inventory update not triggered
"
# Launch the AWX job
resource
=
tower_cli
.
get_resource
(
"
inventory_source
"
)
result
=
resource
.
update
(
inventory_source
,
**
kwargs
)
# Save the AWX job id in the task
task
=
models
.
Task
.
query
.
get
(
rq_job
.
id
)
task
.
awx_job_id
=
result
[
"
id
"
]
db
.
session
.
commit
()
# Monitor the job until done
result
=
resource
.
monitor
(
pk
=
result
[
"
id
"
])
return
result
def
generate_items_excel_file
():
"""
Export all inventory items to an excel file
...
...
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