Alon Bar-Lev has posted comments on this change.

Change subject: Introducing configurator package in vdsm-tool
......................................................................


Patch Set 9:

(3 comments)

....................................................
File lib/vdsm/tool/configurator.py
Line 95: 
Line 96:     try:
Line 97:         with open(sanlock_pid_file, "r") as f:
Line 98:             sanlock_pid = f.readline().strip()
Line 99:         with open(proc_status_path % sanlock_pid, "r") as 
sanlock_status:
I do not follow... I mean:

 os.path.join('/proc', sanlock_pid, 'status')
Line 100:             for status_line in sanlock_status:
Line 101:                 if status_line.startswith(proc_status_group_prefix):
Line 102:                     groups = [int(x) for x in
Line 103:                               
status_line[len(proc_status_group_prefix):].


Line 110:         if e.errno == os.errno.ENOENT:
Line 111:             raise RuntimeError("sanlock service is not running")
Line 112:         raise
Line 113: 
Line 114:     diskimage_gid = grp.getgrnam(DISKIMAGE_GROUP)[2]
it is quite obvious... but how you prefer...

 if grp.getgrnam(DISKIMAGE_GROUP)[2] not in groups:
Line 115:     if diskimage_gid not in groups:
Line 116:         raise RuntimeError("sanlock service requires restart")
Line 117:     else:
Line 118:         sys.stdout.write("sanlock service is already configured\n")


Line 123: @vdsm.tool.expose("configure-all")
Line 124: def configure_and_restart_all(*args):
Line 125:     """
Line 126:     Configure related services for vdsm. --force flag is set for
Line 127:     forcing restart of related services after configure
I prefer not to damage system... this means that we cannot configure components 
that are still running... if we could, we could skip the restart...

so logic should be:

 libvirt_configured = check...
 sanlock_configured = check...

 if not force:
     if not libvirt_configured and libvirt running:
         raise cannot configure while running
     if not sanlock_configured and sanlock running:
         raise cannot configure while running

 if not libvirt_configured:
     if running libvirt: stop+mark
     configure libvirt

 if not sanlock_configured:
     if running sanlock: stop+mark
     configure sanlock

 optionally start stopped services
Line 128:     """
Line 129:     libvirt_related_services = ["supervdsmd", "libvirtd"]
Line 130:     service_should_start = []
Line 131: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I16bf5894e7e55a84b4c2a0caacde383ae7c19242
Gerrit-PatchSet: 9
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybron...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to