Skip to content

Commit

Permalink
Merge pull request #90 from sasg/feature_ignore_aliases
Browse files Browse the repository at this point in the history
ignore aliases for different commands
  • Loading branch information
tmatilai committed Nov 30, 2014
2 parents 8f7b5f8 + f332729 commit dee3db3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lib/vagrant-proxyconf/action/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ def write_config(config, opts = {})

logger.debug "Configuration (#{path}):\n#{config}"
@machine.communicate.tap do |comm|
comm.sudo("rm #{tmp}", error_check: false)
comm.sudo("rm -f #{tmp}", error_check: false)
comm.upload(local_tmp.path, tmp)
comm.sudo("chmod #{opts[:mode] || '0644'} #{tmp}")
comm.sudo("chown #{opts[:owner] || 'root:root'} #{tmp}")
comm.sudo("mkdir -p #{File.dirname(path)}")
comm.sudo("mv #{tmp} #{path}")
comm.sudo("mv -f #{tmp} #{path}")
end
end

Expand Down
6 changes: 3 additions & 3 deletions lib/vagrant-proxyconf/action/configure_docker_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ def write_docker_config
sed_script = docker_sed_script
local_tmp = tempfile(docker_config)

comm.sudo("rm #{tmp}", error_check: false)
comm.sudo("rm -f #{tmp}", error_check: false)
comm.upload(local_tmp.path, tmp)
comm.sudo("touch #{path}")
comm.sudo("sed -e '#{sed_script}' #{path} > #{path}.new")
comm.sudo("cat #{tmp} >> #{path}.new")
comm.sudo("chmod 0644 #{path}.new")
comm.sudo("chown root:root #{path}.new")
comm.sudo("mv #{path}.new #{path}")
comm.sudo("rm #{tmp}")
comm.sudo("mv -f #{path}.new #{path}")
comm.sudo("rm -f #{tmp}")
comm.sudo(service_restart_command)
end
end
Expand Down
6 changes: 3 additions & 3 deletions lib/vagrant-proxyconf/action/configure_env_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ def write_environment_config
local_tmp = tempfile(environment_config)

@machine.communicate.tap do |comm|
comm.sudo("rm #{tmp}", error_check: false)
comm.sudo("rm -f #{tmp}", error_check: false)
comm.upload(local_tmp.path, tmp)
comm.sudo("touch #{path}")
comm.sudo("sed -e '#{sed_script}' #{path} > #{path}.new")
comm.sudo("cat #{tmp} >> #{path}.new")
comm.sudo("chmod 0644 #{path}.new")
comm.sudo("chown root:root #{path}.new")
comm.sudo("mv #{path}.new #{path}")
comm.sudo("rm #{tmp}")
comm.sudo("mv -f #{path}.new #{path}")
comm.sudo("rm -f #{tmp}")
end
end

Expand Down
6 changes: 3 additions & 3 deletions lib/vagrant-proxyconf/action/configure_yum_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ def configure_machine
path = config_path

@machine.communicate.tap do |comm|
comm.sudo("rm #{tmp}", error_check: false)
comm.sudo("rm -f #{tmp}", error_check: false)
comm.upload(ProxyConf.resource("yum_config.awk"), tmp)
comm.sudo("touch #{path}")
comm.sudo("gawk -f #{tmp} #{proxy_params} #{path} > #{path}.new")
comm.sudo("chmod 0644 #{path}.new")
comm.sudo("chown root:root #{path}.new")
comm.sudo("mv #{path}.new #{path}")
comm.sudo("rm #{tmp}")
comm.sudo("mv -f #{path}.new #{path}")
comm.sudo("rm -f #{tmp}")
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/vagrant-proxyconf/cap/coreos/docker_proxy_conf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.docker_proxy_conf(machine)
env_file='EnvironmentFile=-\/etc\/default\/docker'
comm.sudo("sed -e 's/\\[Service\\]/[Service]\\n#{env_file}/g' #{src_file} > #{tmp_file}")

comm.sudo('mv /tmp/docker.service /etc/systemd/system/')
comm.sudo('mv -f /tmp/docker.service /etc/systemd/system/')
comm.sudo('systemctl daemon-reload')
end
'/etc/default/docker'
Expand Down

0 comments on commit dee3db3

Please sign in to comment.