From 158b9b664d9bf648c1cc12bef2cede554ace2570 Mon Sep 17 00:00:00 2001 From: Mark Chance Date: Thu, 10 Sep 2015 08:25:04 -0600 Subject: [PATCH] update version, fix fail msgs --- cloud/amazon/ecs_task.py | 2 +- cloud/amazon/ecs_task_facts.py | 39 ++++++++-------------------------- 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/cloud/amazon/ecs_task.py b/cloud/amazon/ecs_task.py index ce9fa2e85a8..32bad410606 100644 --- a/cloud/amazon/ecs_task.py +++ b/cloud/amazon/ecs_task.py @@ -121,7 +121,7 @@ class EcsExecManager: module.fail_json(msg="Region must be specified as a parameter, in EC2_REGION or AWS_REGION environment variables or in boto configuration file") self.ecs = boto3_conn(module, conn_type='client', resource='ecs', region=region, endpoint=ec2_url, **aws_connect_kwargs) except boto.exception.NoAuthHandlerFound, e: - self.module.fail_json(msg=str(e)) + self.module.fail_json(msg="Can't authorize connection - "+str(e)) def list_tasks(self, cluster_name, service_name, status): response = self.ecs.list_tasks( diff --git a/cloud/amazon/ecs_task_facts.py b/cloud/amazon/ecs_task_facts.py index 541bfaee3c1..d5191a271c0 100644 --- a/cloud/amazon/ecs_task_facts.py +++ b/cloud/amazon/ecs_task_facts.py @@ -20,7 +20,7 @@ module: ecs_task_facts short_description: return facts about tasks in ecs description: - Describes or lists tasks. -version_added: 1.9 +version_added: 2.0 options: details: description: @@ -64,37 +64,16 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. # Basic listing example -- ecs_task: +- ecs_task_facts: + cluster=test-cluster + task_list=123456789012345678901234567890123456 + +# Listing tasks with details +- ecs_task_facts: + details: true cluster=test-cluster task_list=123456789012345678901234567890123456 -# Basic example of deregistering task -- ecs_task: - state: absent - family: console-test-tdn - revision: 1 -''' -RETURN = ''' -cache_updated: - description: if the cache was updated or not - returned: success, in some cases - type: boolean - sample: True -cache_update_time: - description: time of the last cache update (0 if unknown) - returned: success, in some cases - type: datetime - sample: 1425828348000 -stdout: - description: output from apt - returned: success, when needed - type: string - sample: "Reading package lists...\nBuilding dependency tree...\nReading state information...\nThe following extra packages will be installed:\n apache2-bin ..." -stderr: - description: error output from apt - returned: success, when needed - type: string - sample: "AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to ..." ''' try: import json, os @@ -125,7 +104,7 @@ class EcsTaskManager: module.fail_json(msg="Region must be specified as a parameter, in EC2_REGION or AWS_REGION environment variables or in boto configuration file") self.ecs = boto3_conn(module, conn_type='client', resource='ecs', region=region, endpoint=ec2_url, **aws_connect_kwargs) except boto.exception.NoAuthHandlerFound, e: - self.module.fail_json(msg=str(e)) + self.module.fail_json(msg="Can't authorize connection - "+str(e)) def transmogrify(self, params, field, dictionary, arg_name): if field in params and params[field] is not None: