Marcin Mirecki has posted comments on this change. Change subject: vdsm hooks: report hook stderr to Engine if it fails an action ......................................................................
Patch Set 7: (4 comments) https://gerrit.ovirt.org/#/c/42592/7/vdsm/API.py File vdsm/API.py: Line 369: if runHooks: Line 370: try: Line 371: hooks.before_get_vm_stats() Line 372: except hooks.HookError as e: Line 373: return {'status': 10802, 'statsList': str(e)} 10802 - value matching "VDSM command failed" in engine. Create constant? Where? Line 374: Line 375: stats = v.getStats().copy() Line 376: if runHooks: Line 377: stats = hooks.after_get_vm_stats([stats])[0] Line 587: except hooks.HookError as e: Line 588: self.log.debug('Destination VM creation failed due to hook' + Line 589: ' error:' + str(e)) Line 590: # Status code 12 (migration error) will notify the migration Line 591: # source vds that a hook error occured Need to pass information about hook error. Reusing 12 - error during migration. Line 592: return {'status': {'code': 12, 'message': str(e)}} Line 593: self.log.debug('Destination VM creation succeeded') Line 594: return {'status': doneCode, 'migrationPort': 0, Line 595: 'params': response['vmList']} Line 1453: with self._rollback() as rollbackCtx: Line 1454: supervdsm.getProxy().setupNetworks(networks, bondings, options) Line 1455: return rollbackCtx Line 1456: except hooks.HookError as e: Line 1457: return {'status': {'code': 5022, 5022 - matches VDS_NETWORK_ERROR in engine Create constant? Where? Line 1458: 'message': str(e)}} Line 1459: Line 1460: finally: Line 1461: self._cif._networkSemaphore.release() https://gerrit.ovirt.org/#/c/42592/7/vdsm/virt/migration.py File vdsm/virt/migration.py: Line 294: raise Line 295: finally: Line 296: if '_migrationParams' in self._vm.conf: Line 297: del self._vm.conf['_migrationParams'] Line 298: SourceThread._ongoingMigrations.release() Unify exception handling? Different patch? Line 299: except hooks.HookError as e: Line 300: self.status = {'status': {'code': 12, Line 301: 'message': 'Hook error during migration: ' + Line 302: str(e)}} -- To view, visit https://gerrit.ovirt.org/42592 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibe2d5eb52cf2c8855d9d7d5e0ff1628a6cf1dc51 Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Marcin Mirecki <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Feng Yang <[email protected]> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Marcin Mirecki <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
