Alon Bar-Lev has posted comments on this change.

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


Patch Set 9:

(8 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:
os.path.join?
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]
why do you need this temp variable?
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 111:             raise RuntimeError("sanlock service is not running")
Line 112:         raise
Line 113: 
Line 114:     diskimage_gid = grp.getgrnam(DISKIMAGE_GROUP)[2]
Line 115:     if diskimage_gid not in groups:
should always be:

 if fail:
     raise exception
 continue as usual
Line 116:         raise RuntimeError("sanlock service requires restart")
Line 117:     else:
Line 118:         sys.stdout.write("sanlock service is already configured\n")
Line 119: 


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
well... I expect that if no --force is given and we need to perform change in 
configuration and there is relevant service up to fail... what do you think?
Line 128:     """
Line 129:     libvirt_related_services = ["supervdsmd", "libvirtd"]
Line 130:     service_should_start = []
Line 131: 


Line 130:     service_should_start = []
Line 131: 
Line 132:     force = False
Line 133:     if '--force' in args:
Line 134:         force = True
consider:

 force = '--force' in args

or better to use python opt parser?
Line 135: 
Line 136:     # libvirt configuration
Line 137:     if force:
Line 138:         for srv in libvirt_related_services:


Line 134:         force = True
Line 135: 
Line 136:     # libvirt configuration
Line 137:     if force:
Line 138:         for srv in libvirt_related_services:
consider:

 for srv in libvirt_related_services + ['sanlock']:
Line 139:             if service.service_status(srv):
Line 140:                 service_should_start.append(srv)
Line 141: 
Line 142:     configure_libvirt(*args)


Line 136:     # libvirt configuration
Line 137:     if force:
Line 138:         for srv in libvirt_related_services:
Line 139:             if service.service_status(srv):
Line 140:                 service_should_start.append(srv)
where is the stop?
Line 141: 
Line 142:     configure_libvirt(*args)
Line 143:     for srv in reversed(service_should_start):
Line 144:         service.service_start(srv)


Line 144:         service.service_start(srv)
Line 145: 
Line 146:     # sanlock configuration
Line 147:     if sanlock_check_service(*args) and force:
Line 148:         service.service_restart("sanlock")
remove in favor of above?
Line 149: 


-- 
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