vmc 0.3.13.beta.4 → 0.3.13.beta.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -219,7 +219,7 @@ module VMC::Cli::Command
219
219
  app_services = app[:services]
220
220
  services_apps_hash = provisioned_services_apps_hash
221
221
  app_services.each { |service|
222
- del_service = force && no_prompt ? 'Y' : 'N'
222
+ del_service = force && no_prompt
223
223
  unless no_prompt || force
224
224
  del_service = ask(
225
225
  "Provisioned service [#{service}] detected, would you like to delete it?",
@@ -629,18 +629,23 @@ module VMC::Cli::Command
629
629
 
630
630
  end
631
631
 
632
+ # If no resource needs to be sent, add an empty file to ensure we have
633
+ # a multi-part request that is expected by nginx fronting the CC.
634
+ if VMC::Cli::ZipUtil.get_files_to_pack(explode_dir).empty?
635
+ Dir.chdir(explode_dir) do
636
+ File.new(".__empty__", "w")
637
+ end
638
+ end
632
639
  # Perform Packing of the upload bits here.
633
- unless VMC::Cli::ZipUtil.get_files_to_pack(explode_dir).empty?
634
- display ' Packing application: ', false
635
- VMC::Cli::ZipUtil.pack(explode_dir, upload_file)
636
- display 'OK'.green
640
+ display ' Packing application: ', false
641
+ VMC::Cli::ZipUtil.pack(explode_dir, upload_file)
642
+ display 'OK'.green
637
643
 
638
- upload_size = File.size(upload_file);
639
- if upload_size > 1024*1024
640
- upload_size = (upload_size/(1024.0*1024.0)).round.to_s + 'M'
641
- elsif upload_size > 0
642
- upload_size = (upload_size/1024.0).round.to_s + 'K'
643
- end
644
+ upload_size = File.size(upload_file);
645
+ if upload_size > 1024*1024
646
+ upload_size = (upload_size/(1024.0*1024.0)).round.to_s + 'M'
647
+ elsif upload_size > 0
648
+ upload_size = (upload_size/1024.0).round.to_s + 'K'
644
649
  else
645
650
  upload_size = '0K'
646
651
  end
@@ -648,11 +653,9 @@ module VMC::Cli::Command
648
653
  upload_str = " Uploading (#{upload_size}): "
649
654
  display upload_str, false
650
655
 
651
- unless VMC::Cli::ZipUtil.get_files_to_pack(explode_dir).empty?
652
- FileWithPercentOutput.display_str = upload_str
653
- FileWithPercentOutput.upload_size = File.size(upload_file);
654
- file = FileWithPercentOutput.open(upload_file, 'rb')
655
- end
656
+ FileWithPercentOutput.display_str = upload_str
657
+ FileWithPercentOutput.upload_size = File.size(upload_file);
658
+ file = FileWithPercentOutput.open(upload_file, 'rb')
656
659
 
657
660
  client.upload_app(appname, file, appcloud_resources)
658
661
  display 'OK'.green if VMC::Cli::ZipUtil.get_files_to_pack(explode_dir).empty?
data/lib/cli/version.rb CHANGED
@@ -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.13.beta.4'
5
+ VERSION = '0.3.13.beta.5'
6
6
  end
7
7
  end
data/lib/vmc/client.rb CHANGED
@@ -369,7 +369,7 @@ class VMC::Client
369
369
 
370
370
  req = {
371
371
  :method => method, :url => "#{@target}#{path}",
372
- :payload => payload, :headers => headers
372
+ :payload => payload, :headers => headers, :multipart => true
373
373
  }
374
374
  status, body, response_headers = perform_http_request(req)
375
375
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: vmc
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: 7
5
- version: 0.3.13.beta.4
5
+ version: 0.3.13.beta.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - VMware
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-10-18 00:00:00 -07:00
13
+ date: 2011-10-24 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency