[Buildbot-commits] [Buildbot] #2566: 0.8.8 breaks SlaveLock compability with 0.7.12

Buildbot trac trac at buildbot.net
Thu Sep 19 07:25:56 UTC 2013


#2566: 0.8.8 breaks SlaveLock compability with 0.7.12
-------------------+-----------------------
Reporter:  knirch  |      Owner:
    Type:  defect  |     Status:  new
Priority:  major   |  Milestone:  undecided
 Version:  0.8.8   |   Keywords:
-------------------+-----------------------
 After https://github.com/buildbot/buildbot/commit/0e6fe257 "Lock
 management: store !LockAccess instances in class instances"
 process/buildstep.py dies with exceptions.!AttributeError: !SlaveLock
 instance has no attribute 'lockid'

 This was fixed by reverting the first chunk to process/buildstep.py (and
 importing locks at top)

 {{{
 diff -ru buildbot-0.8.8/buildbot/process/buildstep.py
 buildbot-0.8.8-fix/buildbot/process/buildstep.py
 --- buildbot-0.8.8/buildbot/process/buildstep.py        2013-08-22
 16:43:56.000000000 +0200
 +++ buildbot-0.8.8-fix/buildbot/process/buildstep.py    2013-09-19
 09:20:14.059235733 +0200
 @@ -31,6 +31,8 @@
  from buildbot.process import metrics, properties
  from buildbot.util.eventual import eventually

 +from buildbot.locks import LockAccess
 +
  class BuildStepFailed(Exception):
      pass

 @@ -524,8 +526,15 @@
          self.remote = remote
          self.deferred = defer.Deferred()
          # convert all locks into their real form
 -        self.locks =
 [(self.build.builder.botmaster.getLockByID(access.lockid), access)
 -                        for access in self.locks ]
 +        lock_list = []
 +        for access in self.locks:
 +            if not isinstance(access, LockAccess):
 +                # Buildbot 0.7.7 compability: user did not specify access
 +                access = access.defaultAccess()
 +            lock =
 self.build.builder.botmaster.getLockByID(access.lockid)
 +            lock_list.append((lock, access))
 +        self.locks = lock_list
 +
          # then narrow SlaveLocks down to the slave that this build is
 being
          # run on
          self.locks = [(l.getLock(self.build.slavebuilder.slave), la)
 }}}

-- 
Ticket URL: <http://trac.buildbot.net/ticket/2566>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list