Beispiel #1
0
 def getBuildRequestWithNumber(self, brid, t=None):
     assert isinstance(brid, (int, long))
     
     breq_obj = rpc.RpcProxy('software_dev.commit')
     res = breq_obj.read(brid)
     
     if not res:
         return None
     ssid = brid # short-wire
     ss = self.getSourceStampNumberedNow(ssid, t, res)
     properties = self.get_properties_from_db(breq_obj, brid, t)
     bsid = brid
     br = BuildRequest(res['reason'], ss, res['buildername'], properties)
     br.submittedAt = str2time(res['submitted_at'])
     br.priority = res['priority']
     br.id = brid
     br.bsid = bsid
     return br
Beispiel #2
0
    def getBuildRequestWithNumber(self, brid, t=None):
        assert isinstance(brid, (int, long))

        breq_obj = rpc.RpcProxy('software_dev.commit')
        res = breq_obj.read(brid)

        if not res:
            return None
        ssid = brid  # short-wire
        ss = self.getSourceStampNumberedNow(ssid, t, res)
        properties = self.get_properties_from_db(breq_obj, brid, t)
        bsid = brid
        br = BuildRequest(res['reason'], ss, res['buildername'], properties)
        br.submittedAt = str2time(res['submitted_at'])
        br.priority = res['priority']
        br.id = brid
        br.bsid = bsid
        return br
Beispiel #3
0
 def _txn_getBuildRequestWithNumber(self, t, brid):
     assert isinstance(brid, (int, long))
     t.execute(self.quoteq("SELECT br.buildsetid, bs.reason,"
                           " bs.sourcestampid, br.buildername,"
                           " bs.submitted_at, br.priority"
                           " FROM buildrequests AS br, buildsets AS bs"
                           " WHERE br.id=? AND br.buildsetid=bs.id"),
               (brid,))
     r = t.fetchall()
     if not r:
         return None
     (bsid, reason, ssid, builder_name, submitted_at, priority) = r[0]
     ss = self.getSourceStampNumberedNow(ssid, t)
     properties = self.get_properties_from_db("buildset_properties",
                                              "buildsetid", bsid, t)
     br = BuildRequest(reason, ss, builder_name, properties)
     br.submittedAt = submitted_at
     br.priority = priority
     br.id = brid
     br.bsid = bsid
     return br
Beispiel #4
0
 def _txn_getBuildRequestWithNumber(self, t, brid):
     assert isinstance(brid, (int, long))
     t.execute(
         self.quoteq("SELECT br.buildsetid, bs.reason,"
                     " bs.sourcestampid, br.buildername,"
                     " bs.submitted_at, br.priority"
                     " FROM buildrequests AS br, buildsets AS bs"
                     " WHERE br.id=? AND br.buildsetid=bs.id"), (brid, ))
     r = t.fetchall()
     if not r:
         return None
     (bsid, reason, ssid, builder_name, submitted_at, priority) = r[0]
     ss = self.getSourceStampNumberedNow(ssid, t)
     properties = self.get_properties_from_db("buildset_properties",
                                              "buildsetid", bsid, t)
     br = BuildRequest(reason, ss, builder_name, properties)
     br.submittedAt = submitted_at
     br.priority = priority
     br.id = brid
     br.bsid = bsid
     return br