Aravinda VK has posted comments on this change. Change subject: gluster: verbs for managing services ......................................................................
Patch Set 9: (4 inline comments) .................................................... File vdsm/gluster/cli.py Line 948: "status": "ERROR", Line 949: "pid": "", Line 950: "message": e.message}) Line 951: Line 952: return {"services": serviceStatus} Done .................................................... File vdsm/service.py Line 28: "gluster-swift-proxy", Line 29: "gluster-swift-container", Line 30: "gluster-swift-object", Line 31: "gluster-swift-account", Line 32: "smb"] Done Line 33: Line 34: statusTypes = {"INACTIVE": "STOPPED", Line 35: "DEAD": "STOPPED", Line 36: "STOPPED": "STOPPED", Line 40: "ERROR": "ERROR"} Line 41: Line 42: MSG_SERVICE_UNAVAILABLE = "Service not available or not managed" Line 43: Line 44: ALLOWED_ACTIONS = ["start", "stop", "restart", "status"] For constants it makes sense, but to check that a constant exists in class we need to use hasattr. In case of array/list we check action in ALLOWED_ACTIONS. Do we get any performance advantage if we use "hasattr" instead of "in" Line 45: Line 46: INIT_TYPE = "sysv" Line 47: Line 48: if os.path.isfile('/usr/bin/systemctl'): Line 49: INIT_TYPE = "systemd" Line 50: elif os.path.isfile('/sbin/service'): Line 51: INIT_TYPE = "sysv" Line 52: elif os.path.isfile('/sbin/initctl'): Line 53: INIT_TYPE = "upstart" Done Line 54: Line 55: Line 56: class ServiceActionException(Exception): Line 57: def __init__(self, message): -- To view, visit http://gerrit.ovirt.org/11094 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a16bf566d17e186a66503391dfd04b2f2bb4bb4 Gerrit-PatchSet: 9 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Aravinda VK <avish...@redhat.com> Gerrit-Reviewer: Aravinda VK <avish...@redhat.com> Gerrit-Reviewer: Bala.FA <barum...@redhat.com> Gerrit-Reviewer: Shireesh Anjal <san...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches