rhc 1.35.3 → 1.35.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -109,6 +109,7 @@ module RHC::Commands
109
109
  scaling = options.scaling
110
110
  region = options.region
111
111
  gear_profile = options.gear_size
112
+ ha = nil
112
113
 
113
114
  raise RHC::RegionsAndZonesNotSupportedException if region.present? && !rest_client.supports_regions_and_zones?
114
115
 
@@ -116,6 +117,7 @@ module RHC::Commands
116
117
  scaling = from_app.scalable if scaling.nil?
117
118
  region = from_app.region if region.nil?
118
119
  gear_profile = from_app.gear_profile if gear_profile.nil?
120
+ ha = from_app.ha? if !from_app.ha.nil?
119
121
 
120
122
  if region.present? && !rest_client.allows_region_selection?
121
123
  region = nil
@@ -142,6 +144,7 @@ module RHC::Commands
142
144
  (["From app:", from_app.name] if from_app),
143
145
  ["Gear Size:", options.gear_size || (from_app ? "Copied from '#{from_app.name}'" : "default")],
144
146
  ["Scaling:", (scaling ? "yes" : "no") + (from_app && options.scaling.nil? ? " (copied from '#{from_app.name}')" : '')],
147
+ (["HA:", (ha ? "yes" : "no") + (from_app ? " (copied from '#{from_app.name}')" : '')] if ha.present?),
145
148
  (["Environment Variables:", env.map{|item| "#{item.name}=#{item.value}"}.join(', ')] if env.present?),
146
149
  (["Region:", region + (from_app && options.region.nil? ? " (copied from '#{from_app.name}')" : '')] if region),
147
150
  ].compact
@@ -152,7 +155,7 @@ module RHC::Commands
152
155
  say "Creating application '#{name}' ... "
153
156
 
154
157
  # create the main app
155
- rest_app = create_app(name, cartridges, rest_domain, gear_profile, scaling, options.from_code, env, options.auto_deploy, options.keep_deployments, options.deployment_branch, options.deployment_type, region)
158
+ rest_app = create_app(name, cartridges, rest_domain, gear_profile, scaling, options.from_code, env, options.auto_deploy, options.keep_deployments, options.deployment_branch, options.deployment_type, region, ha)
156
159
  success "done"
157
160
 
158
161
  paragraph{ indent{ success rest_app.messages.map(&:strip) } }
@@ -590,7 +593,7 @@ module RHC::Commands
590
593
  result
591
594
  end
592
595
 
593
- def create_app(name, cartridges, rest_domain, gear_profile=nil, scale=nil, from_code=nil, environment_variables=nil, auto_deploy=nil, keep_deployments=nil, deployment_branch=nil, deployment_type=nil, region=nil)
596
+ def create_app(name, cartridges, rest_domain, gear_profile=nil, scale=nil, from_code=nil, environment_variables=nil, auto_deploy=nil, keep_deployments=nil, deployment_branch=nil, deployment_type=nil, region=nil, ha=nil)
594
597
  app_options = {:cartridges => Array(cartridges)}
595
598
  app_options[:gear_profile] = gear_profile if gear_profile
596
599
  app_options[:scale] = scale if scale
@@ -602,6 +605,7 @@ module RHC::Commands
602
605
  app_options[:deployment_branch] = deployment_branch if deployment_branch
603
606
  app_options[:deployment_type] = deployment_type if deployment_type
604
607
  app_options[:region] = region if region
608
+ app_options[:ha] = ha if ha
605
609
  debug "Creating application '#{name}' with these options - #{app_options.inspect}"
606
610
  rest_domain.add_application(name, app_options)
607
611
  rescue RHC::Rest::Exception => e
@@ -18,9 +18,11 @@ class Object
18
18
 
19
19
  # Avoid a conflict if to_json is already defined
20
20
  unless Object.new.respond_to? :to_json
21
+ #:nocov:
21
22
  def to_json(options=nil)
22
23
  RHC::Json.encode(self)
23
24
  end
25
+ #:nocov:
24
26
  end
25
27
  end
26
28
 
@@ -7,7 +7,7 @@ module RHC
7
7
 
8
8
  define_attr :domain_id, :name, :creation_time, :uuid,
9
9
  :git_url, :app_url, :gear_profile, :framework,
10
- :scalable, :health_check_path, :embedded, :gear_count,
10
+ :scalable, :health_check_path, :embedded, :gear_count, :ha,
11
11
  :ssh_url, :building_app, :cartridges, :initial_git_url,
12
12
  :auto_deploy, :deployment_branch, :deployment_type, :keep_deployments, :deployments
13
13
  :region
@@ -18,6 +18,10 @@ module RHC
18
18
  scalable
19
19
  end
20
20
 
21
+ def ha?
22
+ ha
23
+ end
24
+
21
25
  def id
22
26
  attributes['id'] || uuid
23
27
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 157
4
+ hash: 147
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 35
9
- - 3
10
- version: 1.35.3
9
+ - 4
10
+ version: 1.35.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Red Hat
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2015-04-10 00:00:00 Z
18
+ date: 2015-06-10 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: net-ssh