isotoma/yaybu — pull request #69 by alex2 (2012-04-16 13:32:38+00:00)
Title: Protected strings in environment variable values in Execute resources result in a traceback.

If an environment variable value is a yay protected string, yaybu exits with a traceback. Included are two commits - one to test for the issue, one with a proposed solution to the bug.

```
/-------------------------------- Execute[test] --------------------------------
| # sh -c touch $FOO
| Exception: TypeError('putenv() argument 2 must be string, not String',)
| Exception: putenv() argument 2 must be string, not String
Traceback (most recent call last):
File "/usr/local/bin/yaybu", line 9, in
load_entry_point('Yaybu==0.1.22dev', 'console_scripts', 'yaybu')()
File "/usr/local/lib/python2.6/dist-packages/Yaybu-0.1.22dev-py2.6.egg/yaybu/core/main.py", line 88, in main
rv = r.run(ctx)
File "/usr/local/lib/python2.6/dist-packages/Yaybu-0.1.22dev-py2.6.egg/yaybu/core/runner.py", line 80, in run
changed = ctx.get_bundle().apply(ctx, ctx.get_config())
File "/usr/local/lib/python2.6/dist-packages/Yaybu-0.1.22dev-py2.6.egg/yaybu/core/resource.py", line 336, in apply
if resource.apply(ctx, config):
File "/usr/local/lib/python2.6/dist-packages/Yaybu-0.1.22dev-py2.6.egg/yaybu/core/resource.py", line 180, in apply
changed = prov.apply(context)
File "/usr/local/lib/python2.6/dist-packages/Yaybu-0.1.22dev-py2.6.egg/yaybu/providers/execute.py", line 87, in apply
self.execute(context.shell, command, self.resource.returncode)
File "/usr/local/lib/python2.6/dist-packages/Yaybu-0.1.22dev-py2.6.egg/yaybu/providers/execute.py", line 43, in execute
umask=self.resource.umask
File "/usr/local/lib/python2.6/dist-packages/Yaybu-0.1.22dev-py2.6.egg/yaybu/core/shell.py", line 296, in execute
self.context.changelog.apply(cmd)
File "/usr/local/lib/python2.6/dist-packages/Yaybu-0.1.22dev-py2.6.egg/yaybu/core/change.py", line 227, in apply
return change.apply(text_class(self, self.verbose))
File "/usr/local/lib/python2.6/dist-packages/Yaybu-0.1.22dev-py2.6.egg/yaybu/core/shell.py", line 243, in apply
preexec_fn=self.preexec,
File "/usr/lib/python2.6/subprocess.py", line 633, in __init__
errread, errwrite)
File "/usr/lib/python2.6/subprocess.py", line 1139, in _execute_child
raise child_exception
TypeError: putenv() argument 2 must be string, not String
```