lib/testlab/provisioners/apt_cacher_ng.rb in testlab-0.5.3 vs lib/testlab/provisioners/apt_cacher_ng.rb in testlab-0.5.4
- old
+ new
@@ -51,10 +51,10 @@
script = <<-EOF
mkdir -pv #{File.dirname(apt_conf_d_proxy_file)}
echo 'Acquire::HTTP { Proxy "http://#{gateway_ip}:3142"; };' | tee #{apt_conf_d_proxy_file}
EOF
- container.config[:apt_cacher_exclude_hosts].each do |host|
+ container.config[:apt_cacher_exclude_hosts].nil? or container.config[:apt_cacher_exclude_hosts].each do |host|
script << %(echo 'Acquire::HTTP::Proxy::#{host} "DIRECT";' | tee -a #{apt_conf_d_proxy_file}\n)
end
# Fix the APT sources since LXC mudges them when using apt-cacher-ng
apt_conf_sources_file = File.join(container.lxc.fs_root, "etc", "apt", "sources.list")