Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 5, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions littlechef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
7 changes: 5 additions & 2 deletions littlechef/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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')
Expand Down