From 232dc7110ca1fcaa0147bcce4773845220766869 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Tue, 9 Jan 2018 15:32:05 -0800 Subject: [PATCH] Fix Python 3.7 syntax error in yum_repository. --- .../modules/packaging/os/yum_repository.py | 115 +++++++++--------- test/compile/python3.7-skip.txt | 1 - 2 files changed, 59 insertions(+), 57 deletions(-) delete mode 100644 test/compile/python3.7-skip.txt diff --git a/lib/ansible/modules/packaging/os/yum_repository.py b/lib/ansible/modules/packaging/os/yum_repository.py index c1f80f9769..064a7433ab 100644 --- a/lib/ansible/modules/packaging/os/yum_repository.py +++ b/lib/ansible/modules/packaging/os/yum_repository.py @@ -615,63 +615,66 @@ class YumRepo(object): def main(): # Module settings + argument_spec = dict( + bandwidth=dict(), + baseurl=dict(type='list'), + cost=dict(), + deltarpm_metadata_percentage=dict(), + deltarpm_percentage=dict(), + description=dict(), + enabled=dict(type='bool'), + enablegroups=dict(type='bool'), + exclude=dict(type='list'), + failovermethod=dict(choices=['roundrobin', 'priority']), + file=dict(), + gpgcakey=dict(), + gpgcheck=dict(type='bool'), + gpgkey=dict(type='list'), + http_caching=dict(choices=['all', 'packages', 'none']), + include=dict(), + includepkgs=dict(type='list'), + ip_resolve=dict(choices=['4', '6', 'IPv4', 'IPv6', 'whatever']), + keepalive=dict(type='bool'), + keepcache=dict(choices=['0', '1']), + metadata_expire=dict(), + metadata_expire_filter=dict( + choices=[ + 'never', + 'read-only:past', + 'read-only:present', + 'read-only:future']), + metalink=dict(), + mirrorlist=dict(), + mirrorlist_expire=dict(), + name=dict(required=True), + params=dict(type='dict'), + password=dict(no_log=True), + priority=dict(), + protect=dict(type='bool'), + proxy=dict(), + proxy_password=dict(no_log=True), + proxy_username=dict(), + repo_gpgcheck=dict(type='bool'), + reposdir=dict(default='/etc/yum.repos.d', type='path'), + retries=dict(), + s3_enabled=dict(type='bool'), + skip_if_unavailable=dict(type='bool'), + sslcacert=dict(), + ssl_check_cert_permissions=dict(type='bool'), + sslclientcert=dict(), + sslclientkey=dict(), + sslverify=dict(type='bool'), + state=dict(choices=['present', 'absent'], default='present'), + throttle=dict(), + timeout=dict(), + ui_repoid_vars=dict(), + username=dict(), + ) + + argument_spec['async'] = dict(type='bool') + module = AnsibleModule( - argument_spec=dict( - async=dict(type='bool'), - bandwidth=dict(), - baseurl=dict(type='list'), - cost=dict(), - deltarpm_metadata_percentage=dict(), - deltarpm_percentage=dict(), - description=dict(), - enabled=dict(type='bool'), - enablegroups=dict(type='bool'), - exclude=dict(type='list'), - failovermethod=dict(choices=['roundrobin', 'priority']), - file=dict(), - gpgcakey=dict(), - gpgcheck=dict(type='bool'), - gpgkey=dict(type='list'), - http_caching=dict(choices=['all', 'packages', 'none']), - include=dict(), - includepkgs=dict(type='list'), - ip_resolve=dict(choices=['4', '6', 'IPv4', 'IPv6', 'whatever']), - keepalive=dict(type='bool'), - keepcache=dict(choices=['0', '1']), - metadata_expire=dict(), - metadata_expire_filter=dict( - choices=[ - 'never', - 'read-only:past', - 'read-only:present', - 'read-only:future']), - metalink=dict(), - mirrorlist=dict(), - mirrorlist_expire=dict(), - name=dict(required=True), - params=dict(type='dict'), - password=dict(no_log=True), - priority=dict(), - protect=dict(type='bool'), - proxy=dict(), - proxy_password=dict(no_log=True), - proxy_username=dict(), - repo_gpgcheck=dict(type='bool'), - reposdir=dict(default='/etc/yum.repos.d', type='path'), - retries=dict(), - s3_enabled=dict(type='bool'), - skip_if_unavailable=dict(type='bool'), - sslcacert=dict(), - ssl_check_cert_permissions=dict(type='bool'), - sslclientcert=dict(), - sslclientkey=dict(), - sslverify=dict(type='bool'), - state=dict(choices=['present', 'absent'], default='present'), - throttle=dict(), - timeout=dict(), - ui_repoid_vars=dict(), - username=dict(), - ), + argument_spec=argument_spec, add_file_common_args=True, supports_check_mode=True, ) diff --git a/test/compile/python3.7-skip.txt b/test/compile/python3.7-skip.txt deleted file mode 100644 index 398feb1a79..0000000000 --- a/test/compile/python3.7-skip.txt +++ /dev/null @@ -1 +0,0 @@ -lib/ansible/modules/packaging/os/yum_repository.py