def build_query(self, **kwargs): query = Bugzilla36.build_query(self, **kwargs) # 'include_fields' only available for Bugzilla4+ include_fields = self._convert_include_field_list( kwargs.pop('include_fields', None)) if include_fields: if 'id' not in include_fields: include_fields.append('id') query["include_fields"] = include_fields exclude_fields = self._convert_include_field_list( kwargs.pop('exclude_fields', None)) if exclude_fields: query["exclude_fields"] = exclude_fields return query
def build_query(self, **kwargs): query = Bugzilla36.build_query(self, **kwargs) # 'include_fields' only available for Bugzilla4+ include_fields = kwargs.get('include_fields', None) if not include_fields is None: query["include_fields"] = include_fields # Translate old style fields for newname, oldname in self.field_aliases: if oldname in include_fields: include_fields.remove(oldname) if newname not in include_fields: include_fields.append(newname) # We always need the id if 'id' not in include_fields: include_fields.append('id') return query
def addBugzilla(BZ, AMI, RHEL, ARCH, REGION): if BZ is None: print "**** No bugzilla # was passed, will open one here ****" bugzilla=Bugzilla36(url='https://bugzilla.redhat.com/xmlrpc.cgi',user=BZUSER,password=BZPASS) mySummary=AMI+" "+RHEL+" "+ARCH+" "+REGION RHV = "RHEL"+RHEL BZ_Object=bugzilla.createbug(product="Cloud Image Validation",component="images",version=RHV,rep_platform=ARCH,summary=mySummary) BZ = str(BZ_Object.bug_id) print "Buzilla # = https://bugzilla.redhat.com/show_bug.cgi?id="+ BZ return BZ else: mySummary=AMI+" "+RHEL+" "+ARCH+" "+REGION print "Already opened Buzilla # = https://bugzilla.redhat.com/show_bug.cgi?id="+ BZ return BZ file = open('/tmp/bugzilla',"a") file.write("\n") file.write(BZ) file.write("\t") file.write(mySummary) file.close() os.system("cp "+BASEDIR+"/nohup.out "+BASEDIR+"/nohup_"+AMI+".out ; cat /dev/null > "+BASEDIR+"/nohup.out")
def __init__(self, **kwargs): Bugzilla36.__init__(self, **kwargs)
NOGIT = opts.NOGIT BASEDIR = opts.BASEDIR mandatories = ['BASEDIR','AMI','REGION','SSHKEY','RHEL','AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY', 'ARCH'] for m in mandatories: if not opts.__dict__[m]: print "mandatory option is missing\n" parser.print_help() exit(-1) if BZ is None: print "**** No bugzilla # was passed, will open one here ****" bugzilla=Bugzilla36(url='https://bugzilla.redhat.com/xmlrpc.cgi',user=BZUSER,password=BZPASS) mySummary=AMI+" "+RHEL+" "+ARCH+" "+REGION RHV="RHEL"+RHEL BZ_Object=bugzilla.createbug(product="Cloud Image Validation",component="images",version=RHV,rep_platform=ARCH,summary=mySummary) BZ = str(BZ_Object.bug_id) print "Buzilla # = https://bugzilla.redhat.com/show_bug.cgi?id="+ BZ else: print "Already opened Buzilla # = https://bugzilla.redhat.com/show_bug.cgi?id="+ BZ file = open('/tmp/bugzilla',"w") file.write(BZ) file.close() os.system("cat /dev/null > "+BASEDIR+"/nohup.out")