Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New module to support bugzilla #57067

Open
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
4 participants
@xiangge
Copy link

commented May 28, 2019

SUMMARY

Adding the module to support bugzilla by REST API.

  • Fetch bug by id
  • Comment on bugs
  • Change bugs' status
    See the module's document for more details
ISSUE TYPE

New Module Pull Request

COMPONENT NAME

bugzilla.py

ADDITIONAL INFORMATION

Adding the module to support bugzilla
Adding the module to support bugzilla by REST API.
* Fetch bug by id
* Comment on bugs
* Change bugs' status
See the module's document for more details
@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 28, 2019

@Akasurde
Copy link
Member

left a comment

Would love to see unit test for this new module. Thanks for the PR.

DOCUMENTATION = """
module: bugzilla
version_added: "2.9"
short_description: modify bugs in a Bugzilla instance by xmlrpc

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 29, 2019

Member
Suggested change
short_description: modify bugs in a Bugzilla instance by xmlrpc
short_description: Manage bugs in a Bugzilla instance by xmlrpc
version_added: "2.9"
short_description: modify bugs in a Bugzilla instance by xmlrpc
description:
- Modifybugs in a Bugzilla instance.

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 29, 2019

Member
Suggested change
- Modifybugs in a Bugzilla instance.
- This module can be used to fetch, comment, change status of bugzilla ids in a Bugzilla instance.
uri:
required: true
description:
- Base URI for the Bugzilla instance.

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 29, 2019

Member
Suggested change
- Base URI for the Bugzilla instance.
- Base URI for the Bugzilla instance.
type: str
operation:
required: true
aliases: [ command ]

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 29, 2019

Member
Suggested change
aliases: [ command ]
aliases: [ command ]
type: str
- The operation to perform.
username:
required: true

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 29, 2019

Member
Suggested change
required: true
required: true
type: str
"""

RETURN = '''
bug:

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 29, 2019

Member
Suggested change
bug:
bugzilla_info:

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 29, 2019

Member

or bug_info

if info['status'] not in (200, 201, 204):
module.fail_json(msg=info['msg'])
body = response.read()
if body:

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 29, 2019

Member
Suggested change
if body:
ret = {}
if body:
module.fail_json(msg=info['msg'])
body = response.read()
if body:
return json.loads(body)

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 29, 2019

Member
Suggested change
return json.loads(body)
ret = json.loads(body)
body = response.read()
if body:
return json.loads(body)
else:

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 29, 2019

Member
Suggested change
else:
return ret

# Check we have the necessary per-operation parameters
missing = []
for parm in OP_REQUIRED[op]:

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 29, 2019

Member

You can take a look at require_if example.

@Akasurde Akasurde changed the title Adding the module to support bugzilla New module to support bugzilla May 29, 2019

@ansibot ansibot added the stale_ci label Jun 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.