diff options
| author | Ben Mather <bwhmather@bwhmather.com> | 2014-09-30 08:12:10 +0100 |
|---|---|---|
| committer | Ben Mather <bwhmather@bwhmather.com> | 2014-09-30 08:12:10 +0100 |
| commit | 165bf6439fd1de5c1f6796f388556bd389367d44 (patch) | |
| tree | 619c6d6fb249d114a9ded24a6e50c4ec7af04b37 /source_control/github_hooks.py | |
| parent | 2c79db52bcd4fceee17d94abd01b5dd49ef36b06 (diff) | |
| download | ansible-modules-extras-165bf6439fd1de5c1f6796f388556bd389367d44.tar.gz | |
mark all actions as private
Diffstat (limited to 'source_control/github_hooks.py')
| -rw-r--r-- | source_control/github_hooks.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source_control/github_hooks.py b/source_control/github_hooks.py index 878e3249..7aaff98f 100644 --- a/source_control/github_hooks.py +++ b/source_control/github_hooks.py @@ -87,7 +87,7 @@ def _list(module, hookurl, oauthkey, repo, user): else: return False, response.read() -def clean504(module, hookurl, oauthkey, repo, user): +def _clean504(module, hookurl, oauthkey, repo, user): current_hooks = _list(hookurl, oauthkey, repo, user)[1] decoded = json.loads(current_hooks) @@ -95,11 +95,11 @@ def clean504(module, hookurl, oauthkey, repo, user): if hook['last_response']['code'] == 504: # print "Last response was an ERROR for hook:" # print hook['id'] - delete(module, hookurl, oauthkey, repo, user, hook['id']) + _delete(module, hookurl, oauthkey, repo, user, hook['id']) return 0, current_hooks -def cleanall(module, hookurl, oauthkey, repo, user): +def _cleanall(module, hookurl, oauthkey, repo, user): current_hooks = _list(hookurl, oauthkey, repo, user)[1] decoded = json.loads(current_hooks) @@ -107,11 +107,11 @@ def cleanall(module, hookurl, oauthkey, repo, user): if hook['last_response']['code'] != 200: # print "Last response was an ERROR for hook:" # print hook['id'] - delete(module, hookurl, oauthkey, repo, user, hook['id']) + _delete(module, hookurl, oauthkey, repo, user, hook['id']) return 0, current_hooks -def create(module, hookurl, oauthkey, repo, user, content_type): +def _create(module, hookurl, oauthkey, repo, user, content_type): url = "%s/hooks" % repo values = { "active": True, @@ -132,7 +132,7 @@ def create(module, hookurl, oauthkey, repo, user, content_type): else: return 0, response.read() -def delete(module, hookurl, oauthkey, repo, user, hookid): +def _delete(module, hookurl, oauthkey, repo, user, hookid): url = "%s/hooks/%s" % (repo, hookid) auth = base64.encodestring('%s:%s' % (user, oauthkey)).replace('\n', '') headers = { @@ -165,13 +165,13 @@ def main(): (rc, out) = _list(module, hookurl, oauthkey, repo, user) if action == "clean504": - (rc, out) = clean504(module, hookurl, oauthkey, repo, user) + (rc, out) = _clean504(module, hookurl, oauthkey, repo, user) if action == "cleanall": - (rc, out) = cleanall(module, hookurl, oauthkey, repo, user) + (rc, out) = _cleanall(module, hookurl, oauthkey, repo, user) if action == "create": - (rc, out) = create(module, hookurl, oauthkey, repo, user, content_type) + (rc, out) = _create(module, hookurl, oauthkey, repo, user, content_type) if rc != 0: module.fail_json(msg="failed", result=out) |
