vmc 0.3.23 → 0.4.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. data/bin/vmc +11 -2
  2. data/vmc-ng/LICENSE +746 -0
  3. data/vmc-ng/Rakefile +11 -0
  4. data/vmc-ng/bin/vmc +14 -0
  5. data/vmc-ng/lib/vmc.rb +2 -0
  6. data/vmc-ng/lib/vmc/cli.rb +327 -0
  7. data/vmc-ng/lib/vmc/cli/app.rb +622 -0
  8. data/vmc-ng/lib/vmc/cli/better_help.rb +193 -0
  9. data/vmc-ng/lib/vmc/cli/command.rb +523 -0
  10. data/vmc-ng/lib/vmc/cli/dots.rb +133 -0
  11. data/vmc-ng/lib/vmc/cli/service.rb +122 -0
  12. data/vmc-ng/lib/vmc/cli/user.rb +72 -0
  13. data/vmc-ng/lib/vmc/constants.rb +10 -0
  14. data/vmc-ng/lib/vmc/detect.rb +64 -0
  15. data/vmc-ng/lib/vmc/errors.rb +17 -0
  16. data/vmc-ng/lib/vmc/plugin.rb +40 -0
  17. data/vmc-ng/lib/vmc/version.rb +3 -0
  18. data/{LICENSE → vmc/LICENSE} +0 -0
  19. data/{README.md → vmc/README.md} +1 -5
  20. data/{Rakefile → vmc/Rakefile} +0 -0
  21. data/vmc/bin/vmc +6 -0
  22. data/{caldecott_helper → vmc/caldecott_helper}/Gemfile +0 -0
  23. data/{caldecott_helper → vmc/caldecott_helper}/Gemfile.lock +0 -0
  24. data/{caldecott_helper → vmc/caldecott_helper}/server.rb +0 -0
  25. data/{config → vmc/config}/clients.yml +0 -0
  26. data/{config → vmc/config}/micro/offline.conf +0 -0
  27. data/{config → vmc/config}/micro/paths.yml +0 -0
  28. data/{config → vmc/config}/micro/refresh_ip.rb +0 -0
  29. data/{lib → vmc/lib}/cli.rb +0 -0
  30. data/{lib → vmc/lib}/cli/commands/admin.rb +0 -0
  31. data/{lib → vmc/lib}/cli/commands/apps.rb +0 -0
  32. data/{lib → vmc/lib}/cli/commands/base.rb +0 -0
  33. data/{lib → vmc/lib}/cli/commands/manifest.rb +0 -0
  34. data/{lib → vmc/lib}/cli/commands/micro.rb +0 -0
  35. data/{lib → vmc/lib}/cli/commands/misc.rb +0 -0
  36. data/{lib → vmc/lib}/cli/commands/services.rb +0 -0
  37. data/{lib → vmc/lib}/cli/commands/user.rb +2 -6
  38. data/{lib → vmc/lib}/cli/config.rb +0 -0
  39. data/{lib → vmc/lib}/cli/console_helper.rb +4 -14
  40. data/{lib → vmc/lib}/cli/core_ext.rb +0 -0
  41. data/{lib → vmc/lib}/cli/errors.rb +0 -0
  42. data/{lib → vmc/lib}/cli/frameworks.rb +1 -1
  43. data/{lib → vmc/lib}/cli/manifest_helper.rb +0 -0
  44. data/{lib → vmc/lib}/cli/runner.rb +0 -0
  45. data/{lib → vmc/lib}/cli/services_helper.rb +0 -0
  46. data/{lib → vmc/lib}/cli/tunnel_helper.rb +0 -0
  47. data/{lib → vmc/lib}/cli/usage.rb +0 -0
  48. data/{lib → vmc/lib}/cli/version.rb +1 -1
  49. data/{lib → vmc/lib}/cli/zip_util.rb +0 -0
  50. data/{lib → vmc/lib}/vmc.rb +0 -0
  51. data/{lib → vmc/lib}/vmc/client.rb +0 -0
  52. data/{lib → vmc/lib}/vmc/const.rb +0 -0
  53. data/{lib → vmc/lib}/vmc/micro.rb +0 -0
  54. data/{lib → vmc/lib}/vmc/micro/switcher/base.rb +0 -0
  55. data/{lib → vmc/lib}/vmc/micro/switcher/darwin.rb +0 -0
  56. data/{lib → vmc/lib}/vmc/micro/switcher/dummy.rb +0 -0
  57. data/{lib → vmc/lib}/vmc/micro/switcher/linux.rb +0 -0
  58. data/{lib → vmc/lib}/vmc/micro/switcher/windows.rb +0 -0
  59. data/{lib → vmc/lib}/vmc/micro/vmrun.rb +1 -11
  60. metadata +177 -93
@@ -0,0 +1,3 @@
1
+ module VMC
2
+ VERSION = "0.1.5"
3
+ end
File without changes
@@ -2,7 +2,7 @@
2
2
 
3
3
  The VMware Cloud CLI. This is the command line interface to VMware's Application Platform
4
4
 
5
- _Copyright 2010-2012, VMware, Inc. Licensed under the
5
+ _Copyright 2010-2011, VMware, Inc. Licensed under the
6
6
  MIT license, please see the LICENSE file. All rights reserved._
7
7
 
8
8
  Usage: vmc [options] command [<args>] [command_options]
@@ -100,7 +100,3 @@ MIT license, please see the LICENSE file. All rights reserved._
100
100
  vmc login
101
101
  bundle package
102
102
  vmc push
103
-
104
- ## File a Bug
105
-
106
- To file a bug against Cloud Foundry Open Source and its components, sign up and use our bug tracking system: [http://cloudfoundry.atlassian.net](http://cloudfoundry.atlassian.net)
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.expand_path('../../lib/cli', __FILE__)
4
+
5
+ VMC::Cli::Runner.run(ARGV.dup)
6
+
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,5 +1,3 @@
1
- require "cfoundry"
2
-
3
1
  module VMC::Cli::Command
4
2
 
5
3
  class User < Base
@@ -26,7 +24,7 @@ module VMC::Cli::Command
26
24
  err "Need a password" unless password
27
25
  login_and_save_token(email, password)
28
26
  say "Successfully logged into [#{target_url}]".green
29
- rescue CFoundry::Denied
27
+ rescue VMC::Client::TargetError
30
28
  display "Problem with login, invalid account or password when attempting to login to '#{target_url}'".red
31
29
  retry if (tries += 1) < 3 && prompt_ok && !@options[:password]
32
30
  exit 1
@@ -58,9 +56,7 @@ module VMC::Cli::Command
58
56
  private
59
57
 
60
58
  def login_and_save_token(email, password)
61
- cfoundry = CFoundry::Client.new(client.target)
62
- cfoundry.trace = @client.trace
63
- token = cfoundry.login(:username => email, :password => password)
59
+ token = client.login(email, password)
64
60
  VMC::Cli::Config.store_token(token, @options[:token_file])
65
61
  end
66
62
 
File without changes
@@ -32,20 +32,9 @@ module VMC::Cli
32
32
 
33
33
  def start_local_console(port, appname)
34
34
  auth_info = console_credentials(appname)
35
- banner = "Connecting to '#{appname}' console: "
36
- display banner, false
37
- t = Thread.new do
38
- count = 0
39
- while count < 90 do
40
- display '.', false
41
- sleep 1
42
- count += 1
43
- end
44
- end
35
+ display "Connecting to '#{appname}' console: ", false
45
36
  prompt = console_login(auth_info, port)
46
- Thread.kill(t)
47
- clear(80)
48
- display "#{banner}#{'OK'.green}"
37
+ display "OK".green
49
38
  display "\n"
50
39
  initialize_readline
51
40
  run_console prompt
@@ -58,7 +47,7 @@ module VMC::Cli
58
47
  @telnet_client = telnet_client(port)
59
48
  prompt = nil
60
49
  err_msg = "Login attempt timed out."
61
- 3.times do
50
+ 5.times do
62
51
  begin
63
52
  results = @telnet_client.login("Name"=>auth_info["username"],
64
53
  "Password"=>auth_info["password"])
@@ -78,6 +67,7 @@ module VMC::Cli
78
67
  sleep 5
79
68
  @telnet_client = telnet_client(port)
80
69
  end
70
+ display ".", false
81
71
  end
82
72
  unless prompt
83
73
  close_console
File without changes
File without changes
@@ -86,7 +86,7 @@ module VMC::Cli
86
86
  next if matched_file
87
87
  File.open(fname, 'r') do |f|
88
88
  str = f.read # This might want to be limited
89
- matched_file = fname if (str && str.match(/^\s*require[\s\(]*['"]sinatra(\/base)?['"]/))
89
+ matched_file = fname if (str && str.match(/^\s*require[\s\(]*['"]sinatra['"]/))
90
90
  end
91
91
  end
92
92
  if matched_file
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -2,6 +2,6 @@ module VMC
2
2
  module Cli
3
3
  # This version number is used as the RubyGem release version.
4
4
  # The internal VMC version number is VMC::VERSION.
5
- VERSION = '0.3.23'
5
+ VERSION = '0.3.18'
6
6
  end
7
7
  end
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -76,16 +76,12 @@ 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")
81
79
  restart_dnsmasq
82
80
  end
83
81
 
84
82
  def online!
85
83
  run('runProgramInGuest', '/bin/rm -f /etc/dnsmasq.d/offline.conf')
86
84
  run('runProgramInGuest', '/bin/rm -f /var/vcap/micro/offline')
87
- run('runProgramInGuest',
88
- "/bin/sed -i -e 's/^# //g' /etc/dnsmasq.d/server || true")
89
85
  restart_dnsmasq
90
86
  end
91
87
 
@@ -137,13 +133,7 @@ module VMC::Micro
137
133
  vms.map! { |x| x.downcase }
138
134
  vms.include?(@vmx.downcase)
139
135
  else
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))
136
+ vms.include?(@vmx)
147
137
  end
148
138
  end
149
139
 
metadata CHANGED
@@ -1,13 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 61
5
- prerelease:
4
+ hash: 62196449
5
+ prerelease: 6
6
6
  segments:
7
7
  - 0
8
- - 3
9
- - 23
10
- version: 0.3.23
8
+ - 4
9
+ - 0
10
+ - beta
11
+ - 1
12
+ version: 0.4.0.beta.1
11
13
  platform: ruby
12
14
  authors:
13
15
  - VMware
@@ -15,7 +17,7 @@ autorequire:
15
17
  bindir: bin
16
18
  cert_chain: []
17
19
 
18
- date: 2012-10-22 00:00:00 Z
20
+ date: 2012-05-30 00:00:00 Z
19
21
  dependencies:
20
22
  - !ruby/object:Gem::Dependency
21
23
  name: json_pure
@@ -23,14 +25,6 @@ dependencies:
23
25
  requirement: &id001 !ruby/object:Gem::Requirement
24
26
  none: false
25
27
  requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 1
29
- segments:
30
- - 1
31
- - 5
32
- - 1
33
- version: 1.5.1
34
28
  - - <
35
29
  - !ruby/object:Gem::Version
36
30
  hash: 11
@@ -39,6 +33,14 @@ dependencies:
39
33
  - 7
40
34
  - 0
41
35
  version: 1.7.0
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ hash: 1
39
+ segments:
40
+ - 1
41
+ - 5
42
+ - 1
43
+ version: 1.5.1
42
44
  type: :runtime
43
45
  version_requirements: *id001
44
46
  - !ruby/object:Gem::Dependency
@@ -63,14 +65,6 @@ dependencies:
63
65
  requirement: &id003 !ruby/object:Gem::Requirement
64
66
  none: false
65
67
  requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- hash: 13
69
- segments:
70
- - 1
71
- - 6
72
- - 1
73
- version: 1.6.1
74
68
  - - <
75
69
  - !ruby/object:Gem::Version
76
70
  hash: 11
@@ -79,6 +73,14 @@ dependencies:
79
73
  - 7
80
74
  - 0
81
75
  version: 1.7.0
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ hash: 13
79
+ segments:
80
+ - 1
81
+ - 6
82
+ - 1
83
+ version: 1.6.1
82
84
  type: :runtime
83
85
  version_requirements: *id003
84
86
  - !ruby/object:Gem::Dependency
@@ -162,118 +164,198 @@ dependencies:
162
164
  type: :runtime
163
165
  version_requirements: *id008
164
166
  - !ruby/object:Gem::Dependency
165
- name: cfoundry
167
+ name: rake
166
168
  prerelease: false
167
169
  requirement: &id009 !ruby/object:Gem::Requirement
168
170
  none: false
169
171
  requirements:
170
- - - ~>
172
+ - - ">="
171
173
  - !ruby/object:Gem::Version
172
- hash: 115
174
+ hash: 3
173
175
  segments:
174
176
  - 0
175
- - 3
176
- - 48
177
- version: 0.3.48
177
+ version: "0"
178
178
  type: :runtime
179
179
  version_requirements: *id009
180
180
  - !ruby/object:Gem::Dependency
181
- name: rake
181
+ name: rspec
182
182
  prerelease: false
183
183
  requirement: &id010 !ruby/object:Gem::Requirement
184
184
  none: false
185
185
  requirements:
186
- - - ">="
186
+ - - ~>
187
187
  - !ruby/object:Gem::Version
188
- hash: 3
188
+ hash: 27
189
189
  segments:
190
+ - 1
191
+ - 3
190
192
  - 0
191
- version: "0"
192
- type: :development
193
+ version: 1.3.0
194
+ type: :runtime
193
195
  version_requirements: *id010
194
196
  - !ruby/object:Gem::Dependency
195
- name: rspec
197
+ name: webmock
196
198
  prerelease: false
197
199
  requirement: &id011 !ruby/object:Gem::Requirement
198
200
  none: false
199
201
  requirements:
200
202
  - - ~>
201
203
  - !ruby/object:Gem::Version
202
- hash: 27
204
+ hash: 3
203
205
  segments:
204
206
  - 1
205
- - 3
207
+ - 5
206
208
  - 0
207
- version: 1.3.0
208
- type: :development
209
+ version: 1.5.0
210
+ type: :runtime
209
211
  version_requirements: *id011
210
212
  - !ruby/object:Gem::Dependency
211
- name: webmock
213
+ name: json_pure
212
214
  prerelease: false
213
215
  requirement: &id012 !ruby/object:Gem::Requirement
214
216
  none: false
215
217
  requirements:
216
218
  - - ~>
217
219
  - !ruby/object:Gem::Version
218
- hash: 3
220
+ hash: 5
219
221
  segments:
220
222
  - 1
223
+ - 6
221
224
  - 5
222
- - 0
223
- version: 1.5.0
224
- type: :development
225
+ version: 1.6.5
226
+ type: :runtime
225
227
  version_requirements: *id012
226
- description: Client library and CLI that provides access to the VMware Cloud Application Platform.
228
+ - !ruby/object:Gem::Dependency
229
+ name: interact
230
+ prerelease: false
231
+ requirement: &id013 !ruby/object:Gem::Requirement
232
+ none: false
233
+ requirements:
234
+ - - ~>
235
+ - !ruby/object:Gem::Version
236
+ hash: 13
237
+ segments:
238
+ - 0
239
+ - 4
240
+ - 1
241
+ version: 0.4.1
242
+ type: :runtime
243
+ version_requirements: *id013
244
+ - !ruby/object:Gem::Dependency
245
+ name: cfoundry
246
+ prerelease: false
247
+ requirement: &id014 !ruby/object:Gem::Requirement
248
+ none: false
249
+ requirements:
250
+ - - ~>
251
+ - !ruby/object:Gem::Version
252
+ hash: 31
253
+ segments:
254
+ - 0
255
+ - 1
256
+ - 2
257
+ version: 0.1.2
258
+ type: :runtime
259
+ version_requirements: *id014
260
+ - !ruby/object:Gem::Dependency
261
+ name: thor
262
+ prerelease: false
263
+ requirement: &id015 !ruby/object:Gem::Requirement
264
+ none: false
265
+ requirements:
266
+ - - ~>
267
+ - !ruby/object:Gem::Version
268
+ hash: 43
269
+ segments:
270
+ - 0
271
+ - 14
272
+ - 6
273
+ version: 0.14.6
274
+ type: :runtime
275
+ version_requirements: *id015
276
+ - !ruby/object:Gem::Dependency
277
+ name: manifests-vmc-plugin
278
+ prerelease: false
279
+ requirement: &id016 !ruby/object:Gem::Requirement
280
+ none: false
281
+ requirements:
282
+ - - ~>
283
+ - !ruby/object:Gem::Version
284
+ hash: 31
285
+ segments:
286
+ - 0
287
+ - 1
288
+ - 2
289
+ version: 0.1.2
290
+ type: :runtime
291
+ version_requirements: *id016
292
+ description:
227
293
  email: support@vmware.com
228
294
  executables:
229
295
  - vmc
230
296
  extensions: []
231
297
 
232
- extra_rdoc_files:
233
- - README.md
234
- - LICENSE
298
+ extra_rdoc_files: []
299
+
235
300
  files:
236
- - LICENSE
237
- - README.md
238
- - Rakefile
239
- - config/clients.yml
240
- - config/micro/offline.conf
241
- - config/micro/paths.yml
242
- - config/micro/refresh_ip.rb
243
- - lib/cli/commands/admin.rb
244
- - lib/cli/commands/apps.rb
245
- - lib/cli/commands/base.rb
246
- - lib/cli/commands/manifest.rb
247
- - lib/cli/commands/micro.rb
248
- - lib/cli/commands/misc.rb
249
- - lib/cli/commands/services.rb
250
- - lib/cli/commands/user.rb
251
- - lib/cli/config.rb
252
- - lib/cli/console_helper.rb
253
- - lib/cli/core_ext.rb
254
- - lib/cli/errors.rb
255
- - lib/cli/frameworks.rb
256
- - lib/cli/manifest_helper.rb
257
- - lib/cli/runner.rb
258
- - lib/cli/services_helper.rb
259
- - lib/cli/tunnel_helper.rb
260
- - lib/cli/usage.rb
261
- - lib/cli/version.rb
262
- - lib/cli/zip_util.rb
263
- - lib/cli.rb
264
- - lib/vmc/client.rb
265
- - lib/vmc/const.rb
266
- - lib/vmc/micro/switcher/base.rb
267
- - lib/vmc/micro/switcher/darwin.rb
268
- - lib/vmc/micro/switcher/dummy.rb
269
- - lib/vmc/micro/switcher/linux.rb
270
- - lib/vmc/micro/switcher/windows.rb
271
- - lib/vmc/micro/vmrun.rb
272
- - lib/vmc/micro.rb
273
- - lib/vmc.rb
274
- - caldecott_helper/Gemfile
275
- - caldecott_helper/Gemfile.lock
276
- - caldecott_helper/server.rb
301
+ - vmc/LICENSE
302
+ - vmc/README.md
303
+ - vmc/Rakefile
304
+ - vmc/config/clients.yml
305
+ - vmc/config/micro/offline.conf
306
+ - vmc/config/micro/paths.yml
307
+ - vmc/config/micro/refresh_ip.rb
308
+ - vmc/lib/cli/commands/admin.rb
309
+ - vmc/lib/cli/commands/apps.rb
310
+ - vmc/lib/cli/commands/base.rb
311
+ - vmc/lib/cli/commands/manifest.rb
312
+ - vmc/lib/cli/commands/micro.rb
313
+ - vmc/lib/cli/commands/misc.rb
314
+ - vmc/lib/cli/commands/services.rb
315
+ - vmc/lib/cli/commands/user.rb
316
+ - vmc/lib/cli/config.rb
317
+ - vmc/lib/cli/console_helper.rb
318
+ - vmc/lib/cli/core_ext.rb
319
+ - vmc/lib/cli/errors.rb
320
+ - vmc/lib/cli/frameworks.rb
321
+ - vmc/lib/cli/manifest_helper.rb
322
+ - vmc/lib/cli/runner.rb
323
+ - vmc/lib/cli/services_helper.rb
324
+ - vmc/lib/cli/tunnel_helper.rb
325
+ - vmc/lib/cli/usage.rb
326
+ - vmc/lib/cli/version.rb
327
+ - vmc/lib/cli/zip_util.rb
328
+ - vmc/lib/cli.rb
329
+ - vmc/lib/vmc/client.rb
330
+ - vmc/lib/vmc/const.rb
331
+ - vmc/lib/vmc/micro/switcher/base.rb
332
+ - vmc/lib/vmc/micro/switcher/darwin.rb
333
+ - vmc/lib/vmc/micro/switcher/dummy.rb
334
+ - vmc/lib/vmc/micro/switcher/linux.rb
335
+ - vmc/lib/vmc/micro/switcher/windows.rb
336
+ - vmc/lib/vmc/micro/vmrun.rb
337
+ - vmc/lib/vmc/micro.rb
338
+ - vmc/lib/vmc.rb
339
+ - vmc/caldecott_helper/Gemfile
340
+ - vmc/caldecott_helper/Gemfile.lock
341
+ - vmc/caldecott_helper/server.rb
342
+ - vmc/bin/vmc
343
+ - vmc-ng/LICENSE
344
+ - vmc-ng/Rakefile
345
+ - vmc-ng/lib/vmc/cli/app.rb
346
+ - vmc-ng/lib/vmc/cli/better_help.rb
347
+ - vmc-ng/lib/vmc/cli/command.rb
348
+ - vmc-ng/lib/vmc/cli/dots.rb
349
+ - vmc-ng/lib/vmc/cli/service.rb
350
+ - vmc-ng/lib/vmc/cli/user.rb
351
+ - vmc-ng/lib/vmc/cli.rb
352
+ - vmc-ng/lib/vmc/constants.rb
353
+ - vmc-ng/lib/vmc/detect.rb
354
+ - vmc-ng/lib/vmc/errors.rb
355
+ - vmc-ng/lib/vmc/plugin.rb
356
+ - vmc-ng/lib/vmc/version.rb
357
+ - vmc-ng/lib/vmc.rb
358
+ - vmc-ng/bin/vmc
277
359
  - bin/vmc
278
360
  homepage: http://vmware.com
279
361
  licenses: []
@@ -295,16 +377,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
295
377
  required_rubygems_version: !ruby/object:Gem::Requirement
296
378
  none: false
297
379
  requirements:
298
- - - ">="
380
+ - - ">"
299
381
  - !ruby/object:Gem::Version
300
- hash: 3
382
+ hash: 25
301
383
  segments:
302
- - 0
303
- version: "0"
384
+ - 1
385
+ - 3
386
+ - 1
387
+ version: 1.3.1
304
388
  requirements: []
305
389
 
306
390
  rubyforge_project:
307
- rubygems_version: 1.8.24
391
+ rubygems_version: 1.8.23
308
392
  signing_key:
309
393
  specification_version: 3
310
394
  summary: Client library and CLI that provides access to the VMware Cloud Application Platform.