vmc 0.3.21 → 0.3.22
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cli/commands/user.rb +2 -1
- data/lib/cli/version.rb +1 -1
- data/lib/vmc/micro/vmrun.rb +11 -1
- metadata +4 -4
data/lib/cli/commands/user.rb
CHANGED
@@ -26,7 +26,7 @@ module VMC::Cli::Command
|
|
26
26
|
err "Need a password" unless password
|
27
27
|
login_and_save_token(email, password)
|
28
28
|
say "Successfully logged into [#{target_url}]".green
|
29
|
-
rescue
|
29
|
+
rescue CFoundry::Denied
|
30
30
|
display "Problem with login, invalid account or password when attempting to login to '#{target_url}'".red
|
31
31
|
retry if (tries += 1) < 3 && prompt_ok && !@options[:password]
|
32
32
|
exit 1
|
@@ -59,6 +59,7 @@ module VMC::Cli::Command
|
|
59
59
|
|
60
60
|
def login_and_save_token(email, password)
|
61
61
|
cfoundry = CFoundry::Client.new(client.target)
|
62
|
+
cfoundry.trace = @client.trace
|
62
63
|
token = cfoundry.login(:username => email, :password => password)
|
63
64
|
VMC::Cli::Config.store_token(token, @options[:token_file])
|
64
65
|
end
|
data/lib/cli/version.rb
CHANGED
data/lib/vmc/micro/vmrun.rb
CHANGED
@@ -76,12 +76,16 @@ module VMC::Micro
|
|
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 @@ module VMC::Micro
|
|
133
137
|
vms.map! { |x| x.downcase }
|
134
138
|
vms.include?(@vmx.downcase)
|
135
139
|
else
|
136
|
-
|
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
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vmc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 63
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 22
|
10
|
+
version: 0.3.22
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- VMware
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-10-22 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: json_pure
|