[Buildbot-commits] [Buildbot] #2610: Mercurial step env parameter does not accept Property

Buildbot trac trac at buildbot.net
Thu Dec 19 19:49:39 UTC 2013


#2610: Mercurial step env parameter does not accept Property
--------------------+-----------------------
Reporter:  otrempe  |      Owner:
    Type:  defect   |     Status:  new
Priority:  major    |  Milestone:  undecided
 Version:  0.8.8    |   Keywords:
--------------------+-----------------------
 Trying to use Property like this in a Mercurial step:
 (I know it doesn't make sense to set HGRCPATH to buildername, it's just
 for demonstration purpose):

 {{{
 env={'HGRCPATH': Property('buildername')}
 }}}

 I get this error message:

 {{{
 Traceback from remote host -- Traceback (most recent call last):
   File "K:\buildbot\venv\lib\site-packages\twisted\spread\pb.py", line
 891, in _recvMessage
     netResult = object.remoteMessageReceived(self, message, netArgs,
 netKw)
   File "K:\buildbot\venv\lib\site-packages\twisted\spread\flavors.py",
 line 114, in remoteMessageReceived
     state = method(*args, **kw)
   File "K:\buildbot\venv\lib\site-packages\buildslave\bot.py", line 141,
 in remote_startCommand
     d = self.command.doStart()
   File "K:\buildbot\venv\lib\site-packages\buildslave\commands\base.py",
 line 146, in doStart
     d = defer.maybeDeferred(self.start)
 --- <exception caught here> ---
   File "K:\buildbot\venv\lib\site-packages\twisted\internet\defer.py",
 line 139, in maybeDeferred
     result = f(*args, **kw)
   File "K:\buildbot\venv\lib\site-packages\buildslave\commands\shell.py",
 line 41, in start
     logEnviron=args.get('logEnviron', True),
   File "K:\buildbot\venv\lib\site-packages\buildslave\runprocess.py", line
 314, in __init__
     "lists; key '%s' is incorrect" % (key,))
 exceptions.RuntimeError: 'env' values must be strings or lists; key
 'HGRCPATH' is incorrect
 exceptions.RuntimeError: 'env' values must be strings or lists; key
 'HGRCPATH' is incorrect
 }}}

 The code in runprocess.py suggests that only an instance of "basestring"
 is accepted, thus causing this error when trying to pass a Property
 instance:

 {{{
 for key, v in environ.iteritems():
     if v is not None:
         if not isinstance(v, basestring):
             raise RuntimeError("'env' values must be strings or "
                     "lists; key '%s' is incorrect" % (key,))
 }}}

 The documentation clearly suggests that Property should be available in
 env:
 {{{
 env
 a dictionary of environment strings which will be added to the child
 command's environment. The usual property interpolations can be used in
 environment variable names and values - see Properties.
 }}}

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


More information about the Commits mailing list