Repository: ansible/ansible

Issue:
[rax.py] TypeError: get_config() got an unexpected keyword argument 'islist'
### Summary

ansible 2.3 has modified the parameters for `ansible.constants.get_config()`: https://github.com/ansible/ansible/commit/9f6bbf8c2f02cdc70df149095a6623ee0c2c7ba7 so `contrib/inventory/rax.py` is no longer compatible:

```
  Traceback (most recent call last):
    File "/var/lib/awx/venv/tower/lib/python2.7/site-packages/awx/plugins/inventory/rax.py", line 459, in <module>
      main()
    File "/var/lib/awx/venv/tower/lib/python2.7/site-packages/awx/plugins/inventory/rax.py", line 450, in main
      regions = setup()
    File "/var/lib/awx/venv/tower/lib/python2.7/site-packages/awx/plugins/inventory/rax.py", line 433, in setup
      islist=True)
  TypeError: get_config() got an unexpected keyword argument 'islist'
```
### Environment
- Ansible 2.3 (`devel`)
### Steps To Reproduce:

Run an inventory update against rackspace using ansible 2.3.



Discussion:

Resolving patch:
diff --git a/contrib/inventory/rax.py b/contrib/inventory/rax.py
--- a/contrib/inventory/rax.py
+++ b/contrib/inventory/rax.py
@@ -155,8 +155,6 @@
 
 from six import iteritems
 
-from ansible.constants import get_config, mk_boolean
-
 try:
     import json
 except ImportError:
@@ -170,6 +168,8 @@
 
 from time import time
 
+from ansible.constants import get_config, mk_boolean
+
 
 NON_CALLABLES = (basestring, bool, dict, int, list, type(None))
 
@@ -226,12 +226,21 @@ def _list_into_cache(regions):
 
     prefix = get_config(p, 'rax', 'meta_prefix', 'RAX_META_PREFIX', 'meta')
 
-    networks = get_config(p, 'rax', 'access_network', 'RAX_ACCESS_NETWORK',
-                          'public', islist=True)
     try:
-        ip_versions = map(int, get_config(p, 'rax', 'access_ip_version',
-                                          'RAX_ACCESS_IP_VERSION', 4,
-                                          islist=True))
+        # Ansible 2.3+
+        networks = get_config(p, 'rax', 'access_network',
+                'RAX_ACCESS_NETWORK', 'public', value_type='list')
+    except TypeError:
+        # Ansible 2.2.x and below
+        networks = get_config(p, 'rax', 'access_network',
+                'RAX_ACCESS_NETWORK', 'public', islist=True)
+    try:
+        try:
+            ip_versions = map(int, get_config(p, 'rax', 'access_ip_version',
+                'RAX_ACCESS_IP_VERSION', 4, value_type='list'))
+        except TypeError:
+            ip_versions = map(int, get_config(p, 'rax', 'access_ip_version',
+                'RAX_ACCESS_IP_VERSION', 4, islist=True))
     except:
         ip_versions = [4]
     else:
@@ -422,8 +431,15 @@ def setup():
     if region:
         regions.append(region)
     else:
-        region_list = get_config(p, 'rax', 'regions', 'RAX_REGION', 'all',
-                                 islist=True)
+        try:
+            # Ansible 2.3+
+            region_list = get_config(p, 'rax', 'regions', 'RAX_REGION', 'all',
+                    value_type='list')
+        except TypeError:
+            # Ansible 2.2.x and below
+            region_list = get_config(p, 'rax', 'regions', 'RAX_REGION', 'all',
+                    islist=True)
+
         for region in region_list:
             region = region.strip().upper()
             if region == 'ALL':


Test patch: