lib/vmc/micro/vmrun.rb in vmc-0.3.21 vs lib/vmc/micro/vmrun.rb in vmc-0.3.22

- old
+ new

@@ -74,16 +74,20 @@ def offline! path = VMC::Micro.escape_path(VMC::Micro.config_file('offline.conf')) run('CopyFileFromHostToGuest', "#{path} /etc/dnsmasq.d/offline.conf") run('runProgramInGuest', '/usr/bin/touch /var/vcap/micro/offline') + run('runProgramInGuest', + "/bin/sed -i -e 's/^[^#]/# &/g' /etc/dnsmasq.d/server || true") restart_dnsmasq end def online! run('runProgramInGuest', '/bin/rm -f /etc/dnsmasq.d/offline.conf') run('runProgramInGuest', '/bin/rm -f /var/vcap/micro/offline') + run('runProgramInGuest', + "/bin/sed -i -e 's/^# //g' /etc/dnsmasq.d/server || true") restart_dnsmasq end # check to see if the micro cloud has been configured # uses default password to check @@ -131,10 +135,16 @@ vms = list if @platform == :windows vms.map! { |x| x.downcase } vms.include?(@vmx.downcase) else - vms.include?(@vmx) + # Handle vmx being in a symlinked dir. + real_path = nil + begin + real_path = File.realpath(@vmx) + rescue + end + vms.include?(@vmx) || (real_path && vms.include?(real_path)) end end def start run('start') unless running?