Revision e5a92bec snf-cyclades-gtools/synnefo/ganeti/eventd.py
b/snf-cyclades-gtools/synnefo/ganeti/eventd.py | ||
---|---|---|
241 | 241 |
if op.status == "success": |
242 | 242 |
msg["result"] = op.result |
243 | 243 |
|
244 |
if ((op_id in ["OP_INSTANCE_CREATE", "OP_INSTANCE_STARTUP"] and |
|
245 |
op.status == "success") or |
|
246 |
(op_id == "OP_INSTANCE_SET_PARAMS" and |
|
247 |
op.status in ["success", "error", "cancelled"])): |
|
248 |
nics = get_instance_nics(msg["instance"], self.logger) |
|
249 |
msg["nics"] = nics |
|
250 |
|
|
251 | 244 |
msg = json.dumps(msg) |
252 | 245 |
self.logger.debug("Delivering msg: %s (key=%s)", msg, routekey) |
253 | 246 |
|
... | ... | |
289 | 282 |
"operation": op_id, |
290 | 283 |
"job_fields": job_fields} |
291 | 284 |
|
292 |
if op_id in ["OP_INSTANCE_CREATE", "OP_INSTANCE_SET_PARAMS", |
|
293 |
"OP_INSTANCE_STARTUP"]: |
|
294 |
if op.status == "success": |
|
285 |
if ((op_id in ["OP_INSTANCE_CREATE", "OP_INSTANCE_STARTUP"] and |
|
286 |
op.status == "success") or |
|
287 |
(op_id == "OP_INSTANCE_SET_PARAMS" and |
|
288 |
op.status in ["success", "error", "cancelled"])): |
|
295 | 289 |
nics = get_instance_nics(msg["instance"], self.logger) |
296 | 290 |
msg["instance_nics"] = nics |
297 | 291 |
|
Also available in: Unified diff