# Force argument to be a list, SOAPpy returns a dictionary instead of a dictionary list
# Force argument to be a list, SOAPpy returns a dictionary instead of a dictionary list
# if only one bug was found
# if only one bug was found
if(notisinstance(bugs_retrieved,list)):
ifnotisinstance(bugs_retrieved,list):
bugs_retrieved=(bugs_retrieved,)
bugs_retrieved=[bugs_retrieved]
exceptExceptionase:
exceptExceptionase:
log.critical('An error occurred when creating the SOAP proxy at "%s" (ns: "%s"): %s'
log.critical('An error occurred when creating the SOAP proxy at "%s" (ns: "%s"): %s'
%(ClosedBugsPlugin.URL,ClosedBugsPlugin.NS,e))
%(self.URL,self.NS,e))
self.failed('invalid-bug-specified',"%s: One or more bugs closed in this package do not exist"%(self.changes['Closes']),constants.PLUGIN_SEVERITY_ERROR)
return
return
data={
'buglist':bugs,
'raw':{},
'errors':[],
'bugs':defaultdict(list),
}
# Index bugs retrieved
# Index bugs retrieved
bugs_bts={}
forbuginbugs_retrieved:
forbuginbugs_retrieved:
if'key'inbugand'value'inbug:
if'key'inbugand'value'inbug:
bugs_bts[int(bug['key'])]=bug['value']
data["raw"][int(bug['key'])]=bug['value']
else:
else:
continue
continue
severity=constants.PLUGIN_SEVERITY_INFO
forbuginbugs:
forbuginbugs:
ifnotbuginbugs_bts:
ifnotbugindata['raw']:
log.error('Bug #%s does not exist'%bug)
data["errors"].append('Bug #%s does not exist'%bug)