Hi,

*Issue*:
Same new file is getting attached again & again. Delete attachment api is
giving error.


*Error*:
Delete attachment request: [
http://codereview.commvault.com/api/review-requests/98735/file-attachments/58255/
]
2021-01-07 09:24:25 649968   ERROR   : Unable to connect to review board
site for form [114203 (1100080)] with error while doing delete attachment.
[HTTP Error 301: Moved Permanently]


*Code*:

currentAttachmentId = dAttachment['id']
#get id from the 'file_attachments' json part

#Delete each req:
/api/review-requests/{review_request_id}/file-attachments/{file_attachment_id}/
                    sDeleteAttachmentUrlc = ("%sreview-requests/"
 % sRboardBaseurl) +sReviewRequestId+"/file-attachments/"+str
(currentAttachmentId)+'/'
                    umslogger.writeError("Delete attachment request: [%s]"
 % sDeleteAttachmentUrlc)
                    oRequest = urllib2.Request(sDeleteAttachmentUrlc)
                    oRequest.add_header("Authorization", "Basic %s"
 % sLoginAuthorize)
                    oRequest.get_method = lambda: 'DELETE'
                    try:
                        urllib2.urlopen(oRequest, timeout=15)
# Delete will happen here, but a publish is needed.
                    except Exception as err:

#We want to catch and log. Any error doesnt matter, we will still
continue with attach
                        umslogger.writeError(
"Unable to connect to review board site for form [%d (%d
)] with error while doing delete attachment. [%s]" % (gnFormID, gnBuildID,
str(err)))

-- 
Supercharge your Review Board with Power Pack: 
https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: 
https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
"Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/reviewboard/CAASHijqRyu5u9an8MDx4Y5X5zLRdjGBezSVNH84ru0Frd7-Lcg%40mail.gmail.com.

Reply via email to