Skip to content

Instantly share code, notes, and snippets.

@nilliams
Last active September 22, 2016 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nilliams/08682c1ff4220f31a060df9b98349336 to your computer and use it in GitHub Desktop.
Save nilliams/08682c1ff4220f31a060df9b98349336 to your computer and use it in GitHub Desktop.

mercurial.sls looks like:

mercurial:
  hg.latest:
    - name: ssh://hg@bitbucket.org/nickwilliams/influx-salt
    - rev: tip
    - target: /srv
    - identity: /root/deploy_rsa

If I apply with salt-call --local state.apply I get this error:

root@precise64:/home/vagrant# salt-call --local state.apply
[WARNING ] /usr/lib/python2.7/dist-packages/salt/grains/core.py:1493: DeprecationWarning: The "osmajorrelease" will be a type of an integer.

[ERROR   ] Command '['hg', 'pull', '--ssh "ssh -i /root/deploy_rsa"', 'ssh://hg@bitbucket.org/nickwilliams/influx-salt']' failed with return code: 255
[ERROR   ] output: hg pull: option --ssh "ssh -i /root/deploy_rsa" not recognized

But if I take all the args from that [ERROR ] Command debug from above:

'['hg', 'pull', '--ssh "ssh -i /root/deploy_rsa"', 'ssh://hg@bitbucket.org/nickwilliams/influx-salt']'

And stick em together:

>>> ' '.join(['hg', 'pull', '--ssh "ssh -i /root/deploy_rsa"', 'ssh://hg@bitbucket.org/nickwilliams/influx-salt'])
'hg pull --ssh "ssh -i /root/deploy_rsa" ssh://hg@bitbucket.org/nickwilliams/influx-salt'

And run manually, it works fine.

root@precise64:/srv# hg pull --ssh "ssh -i /root/deploy_rsa" ssh://hg@bitbucket.org/nickwilliams/influx-salt
pulling from ssh://hg@bitbucket.org/nickwilliams/influx-salt
searching for changes
no changes found
remote: Warning: Permanently added the RSA host key for IP address '104.192.143.1' to the list of known hosts.

What gives?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment