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
c6bca6fa
Commit
c6bca6fa
authored
Aug 28, 2014
by
e0d
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cr comment
parent
d08319de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
util/vpc-tools/asg_lifcycle_watcher.py
+7
-8
No files found.
util/vpc-tools/asg_lifcycle_watcher.py
View file @
c6bca6fa
...
...
@@ -43,6 +43,11 @@ class LifecycleHandler:
self
.
aws_bin
=
spawn
.
find_executable
(
'aws'
)
self
.
python_bin
=
spawn
.
find_executable
(
'python'
)
self
.
base_cli_command
=
"{python_bin} {aws_bin} --profile {profile} "
.
format
(
python_bin
=
self
.
python_bin
,
aws_bin
=
self
.
aws_bin
,
profile
=
self
.
profile
)
self
.
dry_run
=
dry_run
self
.
ec2_con
=
boto
.
connect_ec2
()
self
.
sqs_con
=
boto
.
connect_sqs
()
...
...
@@ -97,15 +102,9 @@ class LifecycleHandler:
raise
NotImplemented
(
"Encountered message, {message_id}, of unexpected type."
.
format
(
message_id
=
as_message
[
'MessageId'
]))
def
get_base_cli_command
(
self
):
return
"{python_bin} {aws_bin} --profile {profile} "
.
format
(
python_bin
=
self
.
python_bin
,
aws_bin
=
self
.
aws_bin
,
profile
=
self
.
profile
)
def
record_lifecycle_action_heartbeat
(
self
,
asg
,
token
,
hook
):
command
=
self
.
get_base_cli_command
()
+
"autoscaling record-lifecycle-action-heartbeat "
\
command
=
self
.
get_base_cli_command
+
"autoscaling record-lifecycle-action-heartbeat "
\
"--lifecycle-hook-name {hook} "
\
"--auto-scaling-group-name {asg} "
\
"--lifecycle-action-token {token}"
.
format
(
...
...
@@ -114,7 +113,7 @@ class LifecycleHandler:
self
.
run_subprocess_command
(
command
,
self
.
dry_run
)
def
continue_lifecycle
(
self
,
asg
,
token
,
hook
):
command
=
self
.
get_base_cli_command
()
+
"autoscaling complete-lifecycle-action --lifecycle-hook-name {hook} "
\
command
=
self
.
get_base_cli_command
+
"autoscaling complete-lifecycle-action --lifecycle-hook-name {hook} "
\
"--auto-scaling-group-name {asg} --lifecycle-action-token {token} --lifecycle-action-result "
\
"CONTINUE"
.
format
(
hook
=
hook
,
asg
=
asg
,
token
=
token
)
...
...
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