Module 1 - Repo Information - #21
Conversation
| run: pip install ansible==5.5 | ||
|
|
||
| - name: Install PyGithub | ||
| run: pip install PyGithub |
There was a problem hiding this comment.
This has been updated to install PyGithub version 1.55
| ### Collaborator Information | ||
|
|
||
| ``` | ||
| - name: "Functions of Collaborator information module" |
There was a problem hiding this comment.
Functions of Collaborator information module -> List the collaborators of a repository
There was a problem hiding this comment.
This example description has been updated.
| ``` | ||
| ### Webhook | ||
| ``` | ||
| - name: "Add/Modify webhook to GitHub repository MOD 3" |
There was a problem hiding this comment.
Add/Modify webhook to GitHub repository MOD 3 - Manage webhooks of a GitHub repository
There was a problem hiding this comment.
This example description has been updated.
| ### Branch Protection | ||
|
|
||
| ``` | ||
| - name: "Modify branch protections to a branch" |
There was a problem hiding this comment.
Modify branch protections to a branch -> Manage the branch protections rules of a branch
There was a problem hiding this comment.
This example description has been updated.
| ### General Repository | ||
|
|
||
| ``` | ||
| - name: "Create repository within enterprise organization" |
There was a problem hiding this comment.
Create repository within enterprise organization -> Manage a repository within an enterprise organization
There was a problem hiding this comment.
This example description has been updated.
| readme: README.md | ||
| authors: | ||
| - Robert Foreman <foremar1@ohio.edu> | ||
| - Bradley Golski <bg881717@ohio.edu> |
There was a problem hiding this comment.
This has been updated, so now all of our member names are included with emails.
|
|
||
| from ansible.module_utils.basic import AnsibleModule | ||
| from github import Github | ||
| __metaclass__ = type |
| @@ -0,0 +1,46 @@ | |||
| import json | |||
There was a problem hiding this comment.
I could not find where the code in this file was used. Where is it used?
There was a problem hiding this comment.
My mistake, I had originally had a test function in there that returned a json formatted output, but it was removed in the final version of the file. The import has been removed.
| @@ -0,0 +1,342 @@ | |||
| from __future__ import (absolute_import, division, print_function) | |||
There was a problem hiding this comment.
General comment about this tests:
Where does the test code call the code in plugins/modules/repository_information.py
There was a problem hiding this comment.
Future and meta class are for legacy versions of Python. It's for earlier Python versions to work with newer versions of code. Typically it's for people using Python 2 that want to use some functionality of Python 3 versions.
| def set_module_args(args): | ||
| if '_ansible_remote_tmp' not in args: | ||
| args['_ansible_remote_tmp'] = '/tmp' | ||
| if '_ansible_keep_remote_files' not in args: | ||
| args['_ansible_keep_remote_files'] = False | ||
|
|
||
| args = json.dumps({'ANSIBLE_MODULE_ARGS': args}) | ||
| basic._ANSIBLE_ARGS = to_bytes(args) | ||
|
|
||
|
|
||
| class AnsibleExitJson(Exception): | ||
| pass | ||
|
|
||
|
|
||
| class AnsibleFailJson(Exception): | ||
| pass | ||
|
|
||
|
|
||
| def exit_json(*args, **kwargs): | ||
| if 'changed' not in kwargs: | ||
| kwargs['changed'] = False | ||
| raise AnsibleExitJson(kwargs) | ||
|
|
||
|
|
||
| def fail_json(*args, **kwargs): | ||
| kwargs['failed'] = True | ||
| raise AnsibleFailJson(kwargs) | ||
|
|
There was a problem hiding this comment.
Should these have been imported from the utils.py folder?
There was a problem hiding this comment.
Whenever ansible-test units --python 3.9 --venv is run on my machine, Ansible does not recognize functions from other files/directories, only those from Ansible libraries or libraries found in the standard library. I included the functions in a separate file in case the user would like to have the functions separately.
#1