Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
prevent size from going lower than 0
Browse files Browse the repository at this point in the history
  • Loading branch information
buzztroll committed Oct 17, 2012
1 parent cc69894 commit 87ffbfc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyhantom/system/epu/epu_client.py
Expand Up @@ -366,7 +366,11 @@ def terminate_instances(self, user_obj, instance_id, adjust_policy):

if adjust_policy:
desired_size = desc['config']['engine_conf']['domain_desired_size']
desired_size = desired_size - 1
if desired_size < 1:
log(logging.WARN, "Trying to decrease the sie lower than 0")
desired_size = 0
else:
desired_size = desired_size - 1
log(logging.INFO, "decreasing the desired_size to %d" % (desired_size))
conf['engine_conf']['domain_desired_size'] = desired_size

Expand Down

0 comments on commit 87ffbfc

Please sign in to comment.