summaryrefslogtreecommitdiff
path: root/source_control/github_hooks.py
diff options
context:
space:
mode:
authorBen Mather <bwhmather@bwhmather.com>2014-09-29 14:30:26 +0100
committerBen Mather <bwhmather@bwhmather.com>2014-09-29 14:30:26 +0100
commitd95d8c9d988436b7c8256e02d80016dcf5db2b06 (patch)
treea6afcf4a384d7362940723483c9f7e2e96487acc /source_control/github_hooks.py
parentd2d0ed2259fc37b4d17266f820964d3ff58667c7 (diff)
downloadansible-modules-extras-d95d8c9d988436b7c8256e02d80016dcf5db2b06.tar.gz
rename list to list_ to avoid shadowing in github_hooks module
The definition was leaking into ansible.module_utils.basic and causing type checking to fail when running module as script. Not entirely clear why this should be the case.
Diffstat (limited to 'source_control/github_hooks.py')
-rw-r--r--source_control/github_hooks.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/source_control/github_hooks.py b/source_control/github_hooks.py
index 6a8d1ced..c448231f 100644
--- a/source_control/github_hooks.py
+++ b/source_control/github_hooks.py
@@ -69,7 +69,7 @@ EXAMPLES = '''
- local_action: github_hooks action=cleanall user={{ gituser }} oauthkey={{ oauthkey }} repo={{ repo }}
'''
-def list(module, hookurl, oauthkey, repo, user):
+def list_(module, hookurl, oauthkey, repo, user):
url = "%s/hooks" % repo
auth = base64.encodestring('%s:%s' % (user, oauthkey)).replace('\n', '')
headers = {
@@ -82,7 +82,7 @@ def list(module, hookurl, oauthkey, repo, user):
return False, response.read()
def clean504(module, hookurl, oauthkey, repo, user):
- current_hooks = list(hookurl, oauthkey, repo, user)[1]
+ current_hooks = list_(hookurl, oauthkey, repo, user)[1]
decoded = json.loads(current_hooks)
for hook in decoded:
@@ -94,7 +94,7 @@ def clean504(module, hookurl, oauthkey, repo, user):
return 0, current_hooks
def cleanall(module, hookurl, oauthkey, repo, user):
- current_hooks = list(hookurl, oauthkey, repo, user)[1]
+ current_hooks = list_(hookurl, oauthkey, repo, user)[1]
decoded = json.loads(current_hooks)
for hook in decoded:
@@ -154,7 +154,7 @@ def main():
user = module.params['user']
if action == "list":
- (rc, out) = list(module, hookurl, oauthkey, repo, user)
+ (rc, out) = list_(module, hookurl, oauthkey, repo, user)
if action == "clean504":
(rc, out) = clean504(module, hookurl, oauthkey, repo, user)