Code review comment for ~powersj/cloud-init:cii-strings

Revision history for this message
Scott Moser (smoser) wrote :

I'd like 2 things changed
a.) do not use /bin/bash or require it by (Instance/Image).execute.
   That is not python's default shell, unless /bin/sh == /bin/bash on the system.
b.) lets only fix strings where we were already using sh (via sh -c).

throwing stuff to sh just allows for errors and unexpected behavior.

I realize this is a contrived example, but its the kind of unexpected results you can get when you hand things off to shell interpretation and are not careful about quoting

## pretend tmp=$(mktemp -d) happens to return the literal name '/tmp/foo?'
## simulate this behavior by the 'tmp=; mkdir -p'
$ touch /tmp/foo1 /tmp/foo2
$ tmp=/tmp/foo?; mkdir -p "/tmp/foo?"
# ls /tmp/
foo1 foo2 foo?
# rm -Rvf $tmp
removed `/tmp/foo1'
removed `/tmp/foo2'
removed directory: `/tmp/foo?'

## YIKES!

I'll give you a diff or a MP with the changes i'd like.

« Back to merge proposal