Repository: ansible/ansible

Issue:
Ansible Redshift Module erros when wait:true
<!---
Verify first that your issue/request is not already reported on GitHub.
Also test if the latest release, and master branch are affected too.
-->

##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Bug Report
 - Feature Idea
 - Documentation Report

##### COMPONENT NAME
<!--- Name of the module/plugin/task/feature -->

##### ANSIBLE VERSION
<!--- Paste verbatim output from “ansible --version” between quotes below -->
```
2.3.0.0
```

##### CONFIGURATION
<!---
Mention any settings you have changed/added/removed in ansible.cfg
(or using the ANSIBLE_* environment variables).
using customized ansible.cfg
-->

##### OS / ENVIRONMENT
<!---
Mention the OS you are running Ansible from, and the OS you are
managing, or say “N/A” for anything that is not platform-specific.
-->

##### SUMMARY
<!--- Explain the problem briefly -->
Ansible Module : redshift erros out when wait value is true/yes
It doenst error when it is false or no.
##### STEPS TO REPRODUCE
Any redshift module, add wait: yes in yml file
<!---
For bugs, show exactly how to reproduce the problem, using a minimal test-case.
For new features, show how the feature would be used.
-->

<!--- Paste example playbooks or commands between quotes below -->
```yaml
local_action:
        module: redshift
        command: create
        identifier: "x1234"
        node_type: "{{ redshift_node_type  }}"
        username: "ds2.xlarge"
        password: "xxxxxx"
        db_name: "x1234"
        cluster_type: multi-node
        encrypted: true
        number_of_nodes: "4"
        automated_snapshot_retention_period: "35"
        port: 5439
        allow_version_upgrade: false
        publicly_accessible: false
        vpc_security_groups: "SG's"
        param_group_name: "param-group-name"
        subnet: "ssubnet-12344"
        zone: us-east-1a
        maint_window: "mon:03:00-mon:03:30"
        wait: yes
        wait_timeout: 300
      register: redshift_example
      tags:
        - redshift

```

<!--- You can also paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->
Should cretae redshift cluster successfully
##### ACTUAL RESULTS
<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->
fatal: [127.0.0.1 -> localhost]: FAILED! => {
    "changed": false,
    "failed": true,
    "module_stderr": "Traceback (most recent call last):\n  File \"/var/folders/vd/c64ynx3d16vf7nbllrsqdw6ddnhrlt/T/ansible_osq1hY/ansible_module_redshift.py\", line 480, in <module>\n    main()\n  File \"/var/folders/vd/c64ynx3d16vf7nbllrsqdw6ddnhrlt/T/ansible_osq1hY/ansible_module_redshift.py\", line 462, in main\n    (changed, cluster) = create_cluster(module, conn)\n  File \"/var/folders/vd/c64ynx3d16vf7nbllrsqdw6ddnhrlt/T/ansible_osq1hY/ansible_module_redshift.py\", line 288, in create_cluster\n    wait_timeout = time.time() + wait_timeout\nTypeError: unsupported operand type(s) for +: 'float' and 'str'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE",
    "rc": 0
}
<!--- Paste verbatim command output between quotes below -->
```

```



Discussion:

Resolving patch:
diff --git a/lib/ansible/modules/cloud/amazon/redshift.py b/lib/ansible/modules/cloud/amazon/redshift.py
--- a/lib/ansible/modules/cloud/amazon/redshift.py
+++ b/lib/ansible/modules/cloud/amazon/redshift.py
@@ -436,7 +436,7 @@ def main():
         elastic_ip                          = dict(required=False),
         new_cluster_identifier              = dict(aliases=['new_identifier']),
         wait                                = dict(type='bool', default=False),
-        wait_timeout                        = dict(default=300),
+        wait_timeout                        = dict(type='int', default=300),
     )
     )
 


Test patch: