Skip to content

Commit 4501baf

Browse files
committed
Merge branch 'develop' into dynamic-placement-groups
2 parents 2ff1fa5 + 436afe3 commit 4501baf

File tree

5 files changed

+22
-6
lines changed

5 files changed

+22
-6
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
CHANGELOG
33
=========
44

5+
1.0.1
6+
=====
7+
* bugfix:``cfncluster-node``: Fix for nodes being disabled when maintain_initial_size is true
8+
59
1.0.0
610
=====
711
Offiical release of the CfnCluster 1.x CLI, templates and AMIs. Available in all regions except BJS, with

cli/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def read(fname):
2020
return open(os.path.join(os.path.dirname(__file__), fname)).read()
2121

2222
console_scripts = ['cfncluster = cfncluster.cli:main']
23-
version = "1.0.0"
23+
version = "1.0.1"
2424
requires = ['boto>=2.39']
2525

2626
if sys.version_info[:2] == (2, 6):

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
# The short X.Y version.
5353
version = '1.0'
5454
# The full version, including alpha/beta/rc tags.
55-
release = '1.0.0'
55+
release = '1.0.1'
5656

5757
# The language for content autogenerated by Sphinx. Refer to documentation
5858
# for a list of supported languages.

node/nodewatcher/nodewatcher.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python2.6
22

3-
# Copyright 2013-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
# Copyright 2013-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
#
55
# Licensed under the Amazon Software License (the "License"). You may not use this file except in compliance with the
66
# License. A copy of the License is located at
@@ -122,15 +122,25 @@ def lockHost(s,hostname,unlock=False):
122122
return _r
123123

124124
def selfTerminate(region, asg, instance_id):
125+
_as_conn = boto.ec2.autoscale.connect_to_region(region,proxy=boto.config.get('Boto', 'proxy'),
126+
proxy_port=boto.config.get('Boto', 'proxy_port'))
127+
if not maintainSize(region, asg):
128+
log.info("terminating %s" % instance_id)
129+
_as_conn.terminate_instance(instance_id, decrement_capacity=True)
130+
131+
def maintainSize(region, asg):
125132
_as_conn = boto.ec2.autoscale.connect_to_region(region,proxy=boto.config.get('Boto', 'proxy'),
126133
proxy_port=boto.config.get('Boto', 'proxy_port'))
127134
_asg = _as_conn.get_all_groups(names=[asg])[0]
128135
_capacity = _asg.desired_capacity
129136
_min_size = _asg.min_size
130137
log.debug("capacity=%d min_size=%d" % (_capacity, _min_size))
131138
if _capacity > _min_size:
132-
log.info("terminating %s" % instance_id)
133-
_as_conn.terminate_instance(instance_id, decrement_capacity=True)
139+
log.debug('capacity greater then min size.')
140+
return False
141+
else:
142+
log.debug('capacity less then or equal to min size.')
143+
return True
134144

135145
def main():
136146
logging.basicConfig(
@@ -157,6 +167,8 @@ def main():
157167
if jobs == True:
158168
log.info('Instance has active jobs.')
159169
else:
170+
if maintainSize(region, asg):
171+
continue
160172
# avoid race condition by locking and verifying
161173
lockHost(s, hostname)
162174
jobs = getJobs(s, hostname)

node/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def read(fname):
2121

2222
console_scripts = ['sqswatcher = sqswatcher.sqswatcher:main',
2323
'nodewatcher = nodewatcher.nodewatcher:main']
24-
version = "1.0.0"
24+
version = "1.0.1"
2525
requires = ['boto>=2.39', 'paramiko', 'python-dateutil']
2626

2727
if sys.version_info[:2] == (2, 6):

0 commit comments

Comments
 (0)