Permalink
Browse files

If ssh config is provided, pass it to fabric as well.

  • Loading branch information...
1 parent 94dd5e7 commit f2ae192ed95be30901dbad8eaca1db177670de18 @pawelpacana pawelpacana committed Nov 16, 2012
Showing with 9 additions and 2 deletions.
  1. +4 −0 littlechef/chef.py
  2. +5 −2 littlechef/runner.py
View
@@ -125,11 +125,15 @@ def _synchronize_node(configfile, node):
extra_opts = "-q"
if env.follow_symlinks:
extra_opts += " --copy-links"
+ ssh_opts = ""
+ if env.ssh_config_path:
+ ssh_opts += " -F %s" % env.ssh_config_path
rsync_project(
env.node_work_path, './cookbooks ./data_bags ./roles ./site-cookbooks',
exclude=('*.svn', '.bzr*', '.git*', '.hg*'),
delete=True,
extra_opts=extra_opts,
+ ssh_opts=ssh_opts
)
_add_search_patch()
View
@@ -346,8 +346,11 @@ def _readconfig():
if ssh_config:
env.ssh_config = _SSHConfig()
+ env.ssh_config_path = os.path.expanduser(ssh_config)
+ env.use_ssh_config = True
+
try:
- env.ssh_config.parse(open(os.path.expanduser(ssh_config)))
+ env.ssh_config.parse(open(env.ssh_config_path))
except IOError:
msg = "Couldn't open the ssh-config file '{0}'".format(ssh_config)
abort(msg)
@@ -388,7 +391,7 @@ def _readconfig():
else:
if not env.node_work_path:
abort('The "node_work_path" option cannot be empty')
-
+
# Follow symlinks
try:
env.follow_symlinks = config.getboolean('kitchen', 'follow_symlinks')

0 comments on commit f2ae192

Please sign in to comment.