From c08600ed0d7c51cf54ca89b4f443844720ab21c2 Mon Sep 17 00:00:00 2001 From: Rui Carmo Date: Sat, 2 Apr 2016 17:49:19 +0100 Subject: [PATCH] Removed deltas --- piku.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/piku.py b/piku.py index 41bb96f..1334205 100644 --- a/piku.py +++ b/piku.py @@ -503,16 +503,13 @@ def deploy_app(app, settings): try: k, v = map(lambda x: x.strip(), s.split(":", 1)) c = int(v) # check for integer value + if c < 0: + echo("Error: cannot scale type '%s' below 0" % k, fg='red') + return if k not in worker_count: echo("Error: worker type '%s' not present in '%s'" % (k, app), fg='red') return - elif k in ['web','wsgi'] and 0 <= c < 1: - echo("Error: cannot scale type '%s' above 1" % k, fg='red') - return - if c < 0 and int(worker_count[k] - c) >= 0: - v = worker_count[k] = worker_count[k] - c - else: - worker_count[k] = v + worker_count[k] = v echo("Scaling %s to %s for '%s'" % (k, v, app), fg='white') except: echo("Error: malformed setting '%s'" % s, fg='red')