From 92fb19b54701dccbc6611e6166f2d7335904dec6 Mon Sep 17 00:00:00 2001 From: Sunil Shah Date: Sun, 5 Apr 2015 18:22:09 -0700 Subject: [PATCH] Improve error message for restart, closes DCOS-837. --- cli/dcoscli/marathon/main.py | 3 ++- cli/tests/integrations/cli/test_marathon.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cli/dcoscli/marathon/main.py b/cli/dcoscli/marathon/main.py index 2a629c7..3b82fdc 100644 --- a/cli/dcoscli/marathon/main.py +++ b/cli/dcoscli/marathon/main.py @@ -545,7 +545,8 @@ def _restart(app_id, force): if desc['instances'] <= 0: app_id = client.normalize_app_id(app_id) emitter.publish( - 'Unable to restart application {!r} because it is stopped'.format( + 'Unable to perform rolling restart of application {!r} ' + 'because it has no running tasks'.format( app_id, desc['instances'])) return 1 diff --git a/cli/tests/integrations/cli/test_marathon.py b/cli/tests/integrations/cli/test_marathon.py index 772d183..17f0097 100644 --- a/cli/tests/integrations/cli/test_marathon.py +++ b/cli/tests/integrations/cli/test_marathon.py @@ -376,8 +376,8 @@ def test_restarting_stopped_app(): assert returncode == 1 assert stdout == ( - b"Unable to restart application '/zero-instance-app' " - b"because it is stopped\n") + b"Unable to perform rolling restart of application '" + b"/zero-instance-app' because it has no running tasks\n") assert stderr == b'' _remove_app('zero-instance-app')