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
OpenEdx
configuration
Commits
a9e6d103
Commit
a9e6d103
authored
May 27, 2014
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PEP8 cleanup
parent
ae37b137
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
util/vpc-tools/abbey.py
+15
-12
No files found.
util/vpc-tools/abbey.py
View file @
a9e6d103
...
...
@@ -129,11 +129,11 @@ def parse_args():
group
=
parser
.
add_mutually_exclusive_group
()
group
.
add_argument
(
'-b'
,
'--base-ami'
,
required
=
False
,
help
=
"ami to use as a base ami"
,
default
=
"ami-0568456c"
)
help
=
"ami to use as a base ami"
,
default
=
"ami-0568456c"
)
group
.
add_argument
(
'--blessed'
,
action
=
'store_true'
,
help
=
"Look up blessed ami for env-dep-play."
,
default
=
False
)
help
=
"Look up blessed ami for env-dep-play."
,
default
=
False
)
return
parser
.
parse_args
()
...
...
@@ -153,6 +153,7 @@ def get_instance_sec_group(vpc_id):
return
grp_details
[
0
]
.
id
def
get_blessed_ami
():
images
=
ec2
.
get_all_images
(
filters
=
{
...
...
@@ -169,6 +170,7 @@ def get_blessed_ami():
return
images
[
0
]
.
id
def
create_instance_args
():
"""
Looks up security group, subnet
...
...
@@ -542,6 +544,7 @@ def create_ami(instance_id, name, description):
return
image_id
def
launch_and_configure
(
ec2_args
):
"""
Creates an sqs queue, launches an ec2 instance,
...
...
@@ -631,14 +634,15 @@ def launch_and_configure(ec2_args):
return
run_summary
,
ami
def
send_hipchat_message
(
message
):
#If hipchat is configured send the details to the specified room
if
args
.
hipchat_api_token
and
args
.
hipchat_room_id
:
import
hipchat
try
:
hipchat
=
hipchat
.
HipChat
(
token
=
args
.
hipchat_api_token
)
hipchat
.
message_room
(
args
.
hipchat_room_id
,
'AbbeyNormal'
,
message
)
hipchat
.
message_room
(
args
.
hipchat_room_id
,
'AbbeyNormal'
,
message
)
except
Exception
as
e
:
print
(
"Hipchat messaging resulted in an error:
%
s."
%
e
)
...
...
@@ -714,12 +718,11 @@ if __name__ == '__main__':
run
[
0
],
run
[
1
]
/
60
,
run
[
1
]
%
60
)
print
"AMI: {}"
.
format
(
ami
)
message
=
'Finished baking AMI {image_id} for {environment} '
\
'{deployment} {play}.'
.
format
(
image_id
=
ami
,
environment
=
args
.
environment
,
deployment
=
args
.
deployment
,
play
=
args
.
play
)
message
=
'Finished baking AMI {image_id} for {environment} {deployment} {play}.'
.
format
(
image_id
=
ami
,
environment
=
args
.
environment
,
deployment
=
args
.
deployment
,
play
=
args
.
play
)
send_hipchat_message
(
message
)
except
Exception
as
e
:
...
...
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