vmc 0.4.0.beta.48 → 0.4.0.beta.49

Sign up to get free protection for your applications and to get access to all the features.
@@ -164,7 +164,7 @@ module VMC
164
164
  app.name = name
165
165
  app.space = client.current_space if client.current_space
166
166
  app.total_instances = input[:instances]
167
- app.production = input[:plan].capitalize.start_with?("P")
167
+ app.production = input[:plan] =~ /^p/i if v2?
168
168
 
169
169
  detector = Detector.new(client, path)
170
170
  frameworks = detector.all_frameworks
@@ -431,18 +431,28 @@ module VMC
431
431
  memory = input[:memory, app.memory]
432
432
  end
433
433
 
434
- megs = megabytes(memory)
435
- production = plan_name && plan_name.capitalize.start_with?("P")
434
+ instances = instances.to_i
435
+ instances_changed = instances && instances != app.total_instances
436
436
 
437
- memory_changed = megs != app.memory
438
- instances_changed = instances != app.total_instances
439
- plan_changed = production != app.production
437
+ if memory
438
+ memory = megabytes(memory)
439
+ memory_changed = memory != app.memory
440
+ end
441
+
442
+ if plan_name
443
+ fail "Plans not supported on target cloud." unless v2?
440
444
 
441
- return unless memory_changed || instances_changed || plan_changed
445
+ production = plan_name =~ /^p/i
446
+ plan_changed = production != app.production
447
+ end
448
+
449
+ unless memory_changed || instances_changed || plan_changed
450
+ fail "No changes!"
451
+ end
442
452
 
443
453
  with_progress("Scaling #{c(app.name, :name)}") do
444
- app.total_instances = instances.to_i if instances_changed
445
- app.memory = megs if memory_changed
454
+ app.total_instances = instances if instances_changed
455
+ app.memory = memory if memory_changed
446
456
  app.production = production if plan_changed
447
457
  app.update!
448
458
  end
@@ -1,3 +1,3 @@
1
1
  module VMC
2
- VERSION = "0.4.0.beta.48"
2
+ VERSION = "0.4.0.beta.49"
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmc
3
3
  version: !ruby/object:Gem::Version
4
- hash: -3893770324
4
+ hash: -3173992204
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
9
  - 0
10
10
  - beta
11
- - 48
12
- version: 0.4.0.beta.48
11
+ - 49
12
+ version: 0.4.0.beta.49
13
13
  platform: ruby
14
14
  authors:
15
15
  - VMware