Skip to content

Commit 7316f25

Browse files
brianredbeardcrobinso
authored andcommitted
cli: Add support for private attachments
As per the [Bugzilla Attachment API][bzapi] the `is_private` keyword can be included to make an attachment private. This commit adds that support to the attachment verb. It has been tested against Bugzilla v5.0.6 [bzapi]: https://bugzilla.readthedocs.io/en/stable/api/core/v1/attachment.html#create-attachment
1 parent 7de8b22 commit 7316f25

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

bugzilla/_cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,8 @@ def _setup_action_attach_parser(subparsers):
422422
default=[], help="Download all attachments on the given bug")
423423
p.add_argument('-l', '--comment', '--long_desc',
424424
help="Add comment with attachment")
425+
p.add_argument('--private', action='store_true', default=False,
426+
help='Mark new comment as private')
425427

426428

427429
def _setup_action_login_parser(subparsers):
@@ -1015,6 +1017,8 @@ def _do_set_attach(bz, opt, parser):
10151017
kwargs["ispatch"] = True
10161018
if opt.comment:
10171019
kwargs["comment"] = opt.comment
1020+
if opt.private:
1021+
kwargs["is_private"] = True
10181022
desc = opt.desc or os.path.basename(fileobj.name)
10191023

10201024
# Upload attachments

0 commit comments

Comments
 (0)