Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
ac846fa3
Commit
ac846fa3
authored
Jan 17, 2014
by
Feanil Patel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the deployment document instead of overwriting it.
Since mongo doesn't do recursive updates of complex documents.
parent
5117889f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
util/vpc-tools/abbey.py
+11
-12
No files found.
util/vpc-tools/abbey.py
View file @
ac846fa3
...
...
@@ -71,19 +71,18 @@ class MongoConnection:
Adds the built AMI to the deployment
collection
"""
update
=
{
'_id'
:
args
.
jenkins_build
,
'plays'
:
{
args
.
play
:
{
'amis'
:
{},
},
},
}
query
=
{
'_id'
:
args
.
jenkins_build
}
update
[
'plays'
][
args
.
play
][
'amis'
][
args
.
environment
]
=
ami
pprint
(
update
)
self
.
mongo_deployment
.
update
(
query
,
update
,
True
)
deployment
=
self
.
mongo_deployment
.
find_one
(
query
)
try
:
deployment
[
'plays'
][
args
.
play
][
'amis'
][
args
.
environment
]
=
ami
except
KeyError
as
e
:
msg
=
"Unexpected document structure, couldn't write "
+
\
"to path deployment['plays']['{}']['amis']['{}']"
print
msg
.
format
(
args
.
play
,
args
.
environment
)
pprint
(
deployment
)
raise
self
.
mongo_deployment
.
save
(
deployment
)
class
Unbuffered
:
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment