Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HPCasCode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
hpc-team
HPCasCode
Commits
5ece1033
Commit
5ece1033
authored
5 years ago
by
Chris Hines
Browse files
Options
Downloads
Patches
Plain Diff
update a dict rather than overwriting it
parent
9c5073e0
No related branches found
No related tags found
1 merge request
!288
update a dict rather than overwriting it
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/make_inventory.py
+3
-1
3 additions, 1 deletion
scripts/make_inventory.py
with
3 additions
and
1 deletion
scripts/make_inventory.py
+
3
−
1
View file @
5ece1033
...
...
@@ -34,9 +34,11 @@ def gatherInfo(md_key,md_value,authDict,project_id,inventory):
if
groupName
not
in
inventory
:
inventory
[
groupName
]
=
[]
inventory
[
groupName
].
append
(
hostname
)
# Add other metadata
if
not
hostname
in
inventory
[
'
_meta
'
][
'
hostvars
'
]:
inventory
[
'
_meta
'
][
'
hostvars
'
][
hostname
]
=
{}
for
md
in
server
.
metadata
.
items
():
if
md
[
0
]
not
in
(
md_key
,
'
ansible_host_groups
'
):
inventory
[
'
_meta
'
][
'
hostvars
'
][
hostname
]
=
{
md
[
0
]:
md
[
1
]
}
inventory
[
'
_meta
'
][
'
hostvars
'
][
hostname
]
.
update
(
{
md
[
0
]:
md
[
1
]
}
)
if
novaVolumes
:
volDict
=
{}
for
volume
in
novaVolumes
:
...
...
This diff is collapsed.
Click to expand it.
Chris Hines
@chines
mentioned in commit
482f4f0a
·
4 years ago
mentioned in commit
482f4f0a
mentioned in commit 482f4f0a24b511214a62c858d69a3dd0448783be
Toggle commit list
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