openshift-origin-msg-broker-mcollective 1.2.6 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1106,6 +1106,17 @@ module OpenShift
1106
1106
 
1107
1107
  result = MCollectiveApplicationContainerProxy.sanitize_result(output, exitcode)
1108
1108
  #result.exitcode = exitcode
1109
+
1110
+ # raise an exception in case of non-zero exit code from the node
1111
+ if result.exitcode != 0
1112
+ result.debugIO << "Command return code: " + result.exitcode.to_s
1113
+ if result.hasUserActionableError
1114
+ raise OpenShift::UserException.new(result.errorIO.string, result.exitcode, result)
1115
+ else
1116
+ raise OpenShift::NodeException.new("Node execution failure (invalid exit code from node). If the problem persists please contact Red Hat support.", 143, result)
1117
+ end
1118
+ end
1119
+
1109
1120
  result
1110
1121
  end
1111
1122
 
@@ -1165,58 +1176,52 @@ module OpenShift
1165
1176
  end
1166
1177
 
1167
1178
  def run_cartridge_command(framework, app, gear, command, arg=nil, allow_move=true)
1179
+ resultIO = nil
1168
1180
 
1169
1181
  arguments = "'#{gear.name}' '#{app.domain.namespace}' '#{gear.uuid}'"
1170
1182
  arguments += " '#{arg}'" if arg
1171
1183
 
1172
1184
  result = execute_direct(framework, command, arguments)
1185
+
1173
1186
  begin
1174
- resultIO = parse_result(result, app, command)
1175
- rescue OpenShift::InvalidNodeException => e
1176
- if command != 'configure' && allow_move
1177
- @id = e.server_identity
1178
- Rails.logger.debug "DEBUG: Changing server identity of '#{gear.name}' from '#{gear.server_identity}' to '#{@id}'"
1179
- dns_service = OpenShift::DnsService.instance
1180
- dns_service.modify_application(gear.name, app.domain.namespace, get_public_hostname)
1181
- dns_service.publish
1182
- gear.server_identity = @id
1183
- app.save
1184
- #retry
1185
- result = execute_direct(framework, command, arguments)
1186
- resultIO = parse_result(result, app, command)
1187
- else
1188
- raise
1189
- end
1190
- end
1191
- Rails.logger.debug "DEBUG: Cartridge command #{framework}::#{command} exitcode = #{resultIO.exitcode}"
1192
- if resultIO.exitcode != 0
1193
- resultIO.debugIO << "Cartridge return code: " + resultIO.exitcode.to_s
1194
1187
  begin
1195
- if resultIO.hasUserActionableError
1196
- raise OpenShift::UserException.new(resultIO.errorIO.string, resultIO.exitcode)
1188
+ resultIO = parse_result(result, app, command)
1189
+ rescue OpenShift::InvalidNodeException => e
1190
+ if command != 'configure' && allow_move
1191
+ @id = e.server_identity
1192
+ Rails.logger.debug "DEBUG: Changing server identity of '#{gear.name}' from '#{gear.server_identity}' to '#{@id}'"
1193
+ dns_service = OpenShift::DnsService.instance
1194
+ dns_service.modify_application(gear.name, app.domain.namespace, get_public_hostname)
1195
+ dns_service.publish
1196
+ gear.server_identity = @id
1197
+ app.save
1198
+ #retry
1199
+ result = execute_direct(framework, command, arguments)
1200
+ resultIO = parse_result(result, app, command)
1197
1201
  else
1198
- raise OpenShift::NodeException.new("Node execution failure (invalid exit code from node). If the problem persists please contact Red Hat support.", 143, resultIO)
1202
+ raise
1199
1203
  end
1200
- rescue OpenShift::NodeException => e
1201
- if command == 'deconfigure'
1202
- if framework.start_with?('embedded/')
1203
- if has_embedded_app?(app.uuid, framework[9..-1])
1204
- raise
1205
- else
1206
- Rails.logger.debug "DEBUG: Component '#{framework}' in application '#{app.name}' not found on node '#{@id}'. Continuing with deconfigure."
1207
- end
1204
+ end
1205
+ rescue OpenShift::NodeException => e
1206
+ if command == 'deconfigure'
1207
+ if framework.start_with?('embedded/')
1208
+ if has_embedded_app?(app.uuid, framework[9..-1])
1209
+ raise
1208
1210
  else
1209
- if has_app?(app.uuid, app.name)
1210
- raise
1211
- else
1212
- Rails.logger.debug "DEBUG: Application '#{app.name}' not found on node '#{@id}'. Continuing with deconfigure."
1213
- end
1211
+ Rails.logger.debug "DEBUG: Component '#{framework}' in application '#{app.name}' not found on node '#{@id}'. Continuing with deconfigure."
1214
1212
  end
1215
1213
  else
1216
- raise
1214
+ if has_app?(app.uuid, app.name)
1215
+ raise
1216
+ else
1217
+ Rails.logger.debug "DEBUG: Application '#{app.name}' not found on node '#{@id}'. Continuing with deconfigure."
1218
+ end
1217
1219
  end
1220
+ else
1221
+ raise
1218
1222
  end
1219
1223
  end
1224
+
1220
1225
  resultIO
1221
1226
  end
1222
1227
 
@@ -9,7 +9,7 @@
9
9
 
10
10
  Summary: OpenShift plugin for mcollective service
11
11
  Name: rubygem-%{gem_name}
12
- Version: 1.2.6
12
+ Version: 1.2.7
13
13
  Release: 1%{?dist}
14
14
  Group: Development/Languages
15
15
  License: ASL 2.0
@@ -86,6 +86,9 @@ rm -rf %{buildroot}
86
86
  %attr(0644,-,-) %ghost /etc/mcollective/client.cfg
87
87
 
88
88
  %changelog
89
+ * Mon Dec 10 2012 Adam Miller <admiller@redhat.com> 1.2.7-1
90
+ - fix for bug 883607 (abhgupta@redhat.com)
91
+
89
92
  * Fri Dec 07 2012 Adam Miller <admiller@redhat.com> 1.2.6-1
90
93
  - Merge pull request #1035 from abhgupta/abhgupta-dev
91
94
  (openshift+bot@redhat.com)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openshift-origin-msg-broker-mcollective
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 6
10
- version: 1.2.6
9
+ - 7
10
+ version: 1.2.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Krishna Raman
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-12-07 00:00:00 -05:00
18
+ date: 2012-12-10 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency