Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Change micro offline/online commands for new MCF.

The new version of MCF uses dnsmasq slightly differently.

The '|| true' will make these commands not fail when pointing at the old
MCF version.

Change-Id: Ia94e788516f8e8632c75b2a9971aa4340d7bf118
  • Loading branch information...
commit 4d7e05d1ba7afe18cd54e12e78abb5e761e9e616 1 parent b3a02ae
Matthew M. Boedicker mmb authored

Showing 1 changed file with 11 additions and 1 deletion. Show diff stats Hide diff stats

  1. +11 1 lib/vmc/micro/vmrun.rb
12 lib/vmc/micro/vmrun.rb
@@ -76,12 +76,16 @@ def offline!
76 76 path = VMC::Micro.escape_path(VMC::Micro.config_file('offline.conf'))
77 77 run('CopyFileFromHostToGuest', "#{path} /etc/dnsmasq.d/offline.conf")
78 78 run('runProgramInGuest', '/usr/bin/touch /var/vcap/micro/offline')
  79 + run('runProgramInGuest',
  80 + "/bin/sed -i -e 's/^[^#]/# &/g' /etc/dnsmasq.d/server || true")
79 81 restart_dnsmasq
80 82 end
81 83
82 84 def online!
83 85 run('runProgramInGuest', '/bin/rm -f /etc/dnsmasq.d/offline.conf')
84 86 run('runProgramInGuest', '/bin/rm -f /var/vcap/micro/offline')
  87 + run('runProgramInGuest',
  88 + "/bin/sed -i -e 's/^# //g' /etc/dnsmasq.d/server || true")
85 89 restart_dnsmasq
86 90 end
87 91
@@ -133,7 +137,13 @@ def running?
133 137 vms.map! { |x| x.downcase }
134 138 vms.include?(@vmx.downcase)
135 139 else
136   - vms.include?(@vmx)
  140 + # Handle vmx being in a symlinked dir.
  141 + real_path = nil
  142 + begin
  143 + real_path = File.realpath(@vmx)
  144 + rescue
  145 + end
  146 + vms.include?(@vmx) || (real_path && vms.include?(real_path))
137 147 end
138 148 end
139 149

Git Notes

review

Code-Review+2: Alex Suraci <asuraci@vmware.com>
Verified+1: CI Master <cf-ci@rbcon.com>
Submitted-by: Matthew M. Boedicker <mboedicker@rbcon.com>
Submitted-at: Wed, 17 Oct 2012 16:55:27 +0000
Reviewed-on: http://reviews.cloudfoundry.org/10504
Project: vmc
Branch: refs/heads/master

0 comments on commit 4d7e05d

Please sign in to comment.
Something went wrong with that request. Please try again.