Martin Sivák has posted comments on this change.

Change subject: agent: clean vdsm state if vm dies unexpectedly
......................................................................


Patch Set 1: Code-Review-1

(2 comments)

....................................................
File ovirt_hosted_engine_ha/agent/hosted_engine.py
Line 789:             # Loop until state is clear or until timeout
Line 790:             try:
Line 791:                 stats = vdsc.run_vds_client_cmd('0', use_ssl,
Line 792:                                                 'getVmStats', vm_id)
Line 793:             except Exception as e:
Please change this to

except ex.DetailedError as e:

and remove the if condition. You are duplicating the default language logic 
here.
Line 794:                 if isinstance(e, ex.DetailedError) \
Line 795:                         and e.detail == "Virtual machine does not 
exist":
Line 796:                     self._log.info("Vdsm state for VM clean")
Line 797:                     return


Line 806:             self._log.info("Cleaning state for non-running VM")
Line 807:             try:
Line 808:                 vdsc.run_vds_client_cmd('0', use_ssl, 'destroy', 
vm_id)
Line 809:             except Exception as e:
Line 810:                 if isinstance(e, ex.DetailedError) \
the same as above, no need for if, use the exception type in except directly.
Line 811:                         and e.detail == "Virtual machine does not 
exist":
Line 812:                     self._log.info("Vdsm state for VM clean")
Line 813:                     return
Line 814:                 else:


-- 
To view, visit http://gerrit.ovirt.org/19874
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I52c8f41c28fbc1942a8b392b275359df57c1b5ef
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-hosted-engine-ha
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <[email protected]>
Gerrit-Reviewer: Greg Padgett <[email protected]>
Gerrit-Reviewer: Martin Sivák <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to