collective / collective.hostout

zc.buildout deployment and remote control
22 stars 7 forks source link

In fabfile.py, bootstrap_users() uses fabric.contrib.files.append() incorrectly #11

Closed auspex closed 13 years ago

auspex commented 13 years ago

I have to confess, I might have missed something since I don't actually use this myself, but I stole the code for something else and got odd results.

def bootstrap_users():
    """ create users if needed """
    ...
        append(key, '~%s/.ssh/authorized_keys' % owner, use_sudo=True)

The signature of the function is def append(filename, text, use_sudo=False, partial=True, escape=True) but you're appending the text to the file, instead of vice-versa, so my usage of the code resulted in:

[otndc@kil-otndev-1:22000] run: /bin/bash -l -c "PATH=\$PATH:\"/appl/Plone\" echo '~otndc/.ssh/authorized_keys' >> ssh-rsa ...== hostout@hostout"

Somewhere, I guess, I have a file named 'ssh-rsa'

djay commented 13 years ago

Fabric changed this method signature between 0.9 and 1.0. The master version of hostout has a fix for this,

auspex commented 13 years ago

Sorry, I really should have checked...

derek

djay commented 13 years ago

fixed in trunk