@@ -101,7 +101,7 @@ def initialize(options)
101
101
# @param [Service] service the service
102
102
# @param [Role] the role which contains the VMs
103
103
# @param [Node] nodes the list of nodes (VMs) to wait for
104
- def wait_deploy_action ( client , service_id , role_name , nodes , report )
104
+ def wait_deploy_action ( external_user , service_id , role_name , nodes , report )
105
105
if report
106
106
Log . info LOG_COMP , "Waiting #{ nodes } to report ready"
107
107
rc = wait_report_ready ( nodes )
@@ -113,25 +113,25 @@ def wait_deploy_action(client, service_id, role_name, nodes, report)
113
113
if rc [ 0 ]
114
114
@lcm . trigger_action ( :deploy_cb ,
115
115
service_id ,
116
- client ,
116
+ external_user ,
117
117
service_id ,
118
118
role_name ,
119
119
rc [ 1 ] )
120
120
else
121
121
@lcm . trigger_action ( :deploy_failure_cb ,
122
122
service_id ,
123
- client ,
123
+ external_user ,
124
124
service_id ,
125
125
role_name )
126
126
end
127
127
end
128
128
129
129
# Wait for networks to e ready
130
130
#
131
- # @param client [OpenNebula::Client] Client to perform requests
132
- # @param service_id [Integer] Service ID
133
- # @param networks [Array] Network IDs to wait until ready
134
- def wait_deploy_nets_action ( client , service_id , networks )
131
+ # @param external_user [String] External user to impersonate for performing the action
132
+ # @param service_id [Integer] Service ID
133
+ # @param networks [Array] Network IDs to wait until ready
134
+ def wait_deploy_nets_action ( external_user , service_id , networks )
135
135
Log . info LOG_COMP , "Waiting networks #{ networks } to be (READY)"
136
136
rc = wait_nets ( networks , 'READY' )
137
137
@@ -141,15 +141,15 @@ def wait_deploy_nets_action(client, service_id, networks)
141
141
action = :deploy_nets_failure_cb
142
142
end
143
143
144
- @lcm . trigger_action ( action , service_id , client , service_id )
144
+ @lcm . trigger_action ( action , service_id , external_user , service_id )
145
145
end
146
146
147
147
# Wait for networks to e ready
148
148
#
149
- # @param client [OpenNebula::Client] Client to perform requests
149
+ # @param external_user [String] External user to impersonate for performing the action
150
150
# @param service_id [Integer] Service ID
151
151
# @param networks [Array] Network IDs to wait until ready
152
- def wait_undeploy_nets_action ( client , service_id , networks )
152
+ def wait_undeploy_nets_action ( external_user , service_id , networks )
153
153
Log . info LOG_COMP , "Waiting networks #{ networks } to be (DONE)"
154
154
rc = wait_nets ( networks , 'DONE' )
155
155
@@ -159,28 +159,29 @@ def wait_undeploy_nets_action(client, service_id, networks)
159
159
action = :undeploy_nets_failure_cb
160
160
end
161
161
162
- @lcm . trigger_action ( action , service_id , client , service_id )
162
+ @lcm . trigger_action ( action , service_id , external_user , service_id )
163
163
end
164
164
165
165
# Wait for nodes to be in DONE
166
+ # @param [String] External user to impersonate for performing the action
166
167
# @param [service_id] the service id
167
168
# @param [role_name] the role name of the role which contains the VMs
168
169
# @param [nodes] the list of nodes (VMs) to wait for
169
- def wait_undeploy_action ( client , service_id , role_name , nodes )
170
+ def wait_undeploy_action ( external_user , service_id , role_name , nodes )
170
171
Log . info LOG_COMP , "Waiting #{ nodes } to be (DONE, LCM_INIT)"
171
172
rc = wait ( nodes , 'DONE' , 'LCM_INIT' )
172
173
173
174
if rc [ 0 ]
174
175
@lcm . trigger_action ( :undeploy_cb ,
175
176
service_id ,
176
- client ,
177
+ external_user ,
177
178
service_id ,
178
179
role_name ,
179
180
rc [ 1 ] )
180
181
else
181
182
@lcm . trigger_action ( :undeploy_failure_cb ,
182
183
service_id ,
183
- client ,
184
+ external_user ,
184
185
service_id ,
185
186
role_name ,
186
187
rc [ 1 ] )
@@ -189,11 +190,12 @@ def wait_undeploy_action(client, service_id, role_name, nodes)
189
190
190
191
# Wait for nodes to be in RUNNING if OneGate check required it will trigger
191
192
# another action after VMs are RUNNING
193
+ # @param [String] External user to impersonate for performing the action
192
194
# @param [Service] service the service
193
195
# @param [Role] the role which contains the VMs
194
196
# @param [Node] nodes the list of nodes (VMs) to wait for
195
197
# @param [Bool] up true if scalling up false otherwise
196
- def wait_scaleup_action ( client , service_id , role_name , nodes , report )
198
+ def wait_scaleup_action ( external_user , service_id , role_name , nodes , report )
197
199
if report
198
200
Log . info LOG_COMP , "Waiting #{ nodes } to report ready"
199
201
rc = wait_report_ready ( nodes )
@@ -205,42 +207,42 @@ def wait_scaleup_action(client, service_id, role_name, nodes, report)
205
207
if rc [ 0 ]
206
208
@lcm . trigger_action ( :scaleup_cb ,
207
209
service_id ,
208
- client ,
210
+ external_user ,
209
211
service_id ,
210
212
role_name ,
211
213
rc [ 1 ] )
212
214
else
213
215
@lcm . trigger_action ( :scaleup_failure_cb ,
214
216
service_id ,
215
- client ,
217
+ external_user ,
216
218
service_id ,
217
219
role_name )
218
220
end
219
221
end
220
222
221
- def wait_scaledown_action ( client , service_id , role_name , nodes )
223
+ def wait_scaledown_action ( external_user , service_id , role_name , nodes )
222
224
Log . info LOG_COMP , "Waiting #{ nodes } to be (DONE, LCM_INIT)"
223
225
224
226
rc = wait ( nodes , 'DONE' , 'LCM_INIT' )
225
227
226
228
if rc [ 0 ]
227
229
@lcm . trigger_action ( :scaledown_cb ,
228
230
service_id ,
229
- client ,
231
+ external_user ,
230
232
service_id ,
231
233
role_name ,
232
234
rc [ 1 ] )
233
235
else
234
236
@lcm . trigger_action ( :scaledown_failure_cb ,
235
237
service_id ,
236
- client ,
238
+ external_user ,
237
239
service_id ,
238
240
role_name ,
239
241
rc [ 1 ] )
240
242
end
241
243
end
242
244
243
- def wait_add_action ( client , service_id , role_name , nodes , report )
245
+ def wait_add_action ( external_user , service_id , role_name , nodes , report )
244
246
if report
245
247
Log . info LOG_COMP , "Waiting #{ nodes } to report ready"
246
248
rc = wait_report_ready ( nodes )
@@ -252,82 +254,86 @@ def wait_add_action(client, service_id, role_name, nodes, report)
252
254
if rc [ 0 ]
253
255
@lcm . trigger_action ( :add_cb ,
254
256
service_id ,
255
- client ,
257
+ external_user ,
256
258
service_id ,
257
259
role_name ,
258
260
rc [ 1 ] )
259
261
else
260
262
@lcm . trigger_action ( :add_failure_cb ,
261
263
service_id ,
262
- client ,
264
+ external_user ,
263
265
service_id ,
264
266
role_name )
265
267
end
266
268
end
267
269
268
270
# Wait for nodes to be in DONE
271
+ # @param [String] External user to impersonate for performing the action
269
272
# @param [service_id] the service id
270
273
# @param [role_name] the role name of the role which contains the VMs
271
274
# @param [nodes] the list of nodes (VMs) to wait for
272
- def wait_remove_action ( client , service_id , role_name , nodes )
275
+ def wait_remove_action ( external_user , service_id , role_name , nodes )
273
276
Log . info LOG_COMP , "Waiting #{ nodes } to be (DONE, LCM_INIT)"
274
277
rc = wait ( nodes , 'DONE' , 'LCM_INIT' )
275
278
276
279
if rc [ 0 ]
277
280
@lcm . trigger_action ( :remove_cb ,
278
281
service_id ,
279
- client ,
282
+ external_user ,
280
283
service_id ,
281
284
role_name ,
282
285
rc [ 1 ] )
283
286
else
284
287
@lcm . trigger_action ( :remove_failure_cb ,
285
288
service_id ,
286
- client ,
289
+ external_user ,
287
290
service_id ,
288
291
role_name ,
289
292
rc [ 1 ] )
290
293
end
291
294
end
292
295
293
296
# Wait for nodes to be in DONE
297
+ # @param [String] External user to impersonate for performing the action
294
298
# @param [service_id] the service id
295
299
# @param [role_name] the role name of the role which contains the VMs
296
300
# @param [nodes] the list of nodes (VMs) to wait for
297
- def wait_cooldown_action ( client , service_id , role_name , cooldown_time )
301
+ def wait_cooldown_action ( external_user , service_id , role_name , cooldown_time )
298
302
Log . info LOG_COMP , "Waiting #{ cooldown_time } s for cooldown for " \
299
303
"service #{ service_id } and role #{ role_name } ."
300
304
301
305
sleep cooldown_time . to_i
302
306
303
307
@lcm . trigger_action ( :cooldown_cb ,
304
308
service_id ,
305
- client ,
309
+ external_user ,
306
310
service_id ,
307
311
role_name )
308
312
end
309
313
310
314
# Wait for nodes to be in HOLD
315
+ # @param [String] External user to impersonate for performing the action
311
316
# @param [service_id] the service id
312
317
# @param [role_name] the role name of the role which contains the VMs
313
318
# @param [nodes] the list of nodes (VMs) to wait for
314
- def wait_hold_action ( client , service_id , role_name , nodes )
319
+ def wait_hold_action ( external_user , service_id , role_name , nodes )
315
320
Log . info LOG_COMP , "Waiting #{ nodes } to be (HOLD, LCM_INIT)"
316
321
wait ( nodes , 'HOLD' , 'LCM_INIT' )
317
322
318
323
@lcm . trigger_action ( :hold_cb ,
319
324
service_id ,
320
- client ,
325
+ external_user ,
321
326
service_id ,
322
327
role_name )
323
328
end
324
329
325
330
# Wait for nodes to be in RUNNING if OneGate check required it will trigger
326
331
# another action after VMs are RUNNING
332
+ # @param [String] External user to impersonate for performing the action
327
333
# @param [Service] service the service
328
334
# @param [Role] the role which contains the VMs
329
335
# @param [Node] nodes the list of nodes (VMs) to wait for
330
- def wait_release_action ( client , service_id , role_name , nodes , report )
336
+ def wait_release_action ( external_user , service_id , role_name , nodes , report )
331
337
if report
332
338
Log . info LOG_COMP , "Waiting #{ nodes } to report ready"
333
339
rc = wait_report_ready ( nodes )
@@ -339,14 +345,14 @@ def wait_release_action(client, service_id, role_name, nodes, report)
339
345
if rc [ 0 ]
340
346
@lcm . trigger_action ( :release_cb ,
341
347
service_id ,
342
- client ,
348
+ external_user ,
343
349
service_id ,
344
350
role_name ,
345
351
rc [ 1 ] )
346
352
else
347
353
@lcm . trigger_action ( :deploy_failure_cb ,
348
354
service_id ,
349
- client ,
355
+ external_user ,
350
356
service_id ,
351
357
role_name )
352
358
end
0 commit comments