Change in vdsm[master]: contrib: Adding contrib/nfs-check.py

danken at redhat.com danken at redhat.com
Wed Feb 1 07:48:13 UTC 2012


Dan Kenigsberg has posted comments on this change.

Change subject: contrib: Adding contrib/nfs-check.py
......................................................................


Patch Set 4: (12 inline comments)

several minor comments, few (mostly postponable) serious ones.

....................................................
File contrib/nfs-check.py
Line 28:     print "Usage: " +  sys.argv[0] + " server:/target"
please add a few words on what this script is supposed to be doing

Line 36:     def handler(self,signum, frame):
coma, space

Line 41:         process = subprocess.Popen(['mount', "-t", "nfs", cmd, pathName],
please use full path (I don't want to infuriate Yaniv Kaul)

Line 53:             print "Timeout, cannot mount the nfs! Please check the status" \
I'm surprised that an exception in a signal handler reaches here. Was this flow tested?

Line 62:                if not os.path.isfile("/etc/exports"):
use a CONSTANT instead of typing the same string twice

Line 66:                strFound = False
better name: targetFound

Line 67:                with open('/etc/exports', 'r') as f:
why do you expect that nfs server is localhost? that's not the typical use case.
run this logic only if nfsServer resolves to this host.

Line 78:                    print "The local path %s doesn't exist."
I think it would be more informative to at least print the returncode and the error message.

Line 107:             process = subprocess.Popen(['sudo', "-u", "vdsm", "touch", fileTest],
we are root now, we'd better use 'su' for that.

and use full path to su.

Line 122:             if ret != 0:
Consider using something like supervdsmServer._runAs() so that you get the proper OSError, instead of instead of parsing locale-specifiic error messages. (can wait for future patch_

BTW you should make sure LC_ALL=C when running touch.

Line 160:             print "cannot execute umount()!"
print why this has failed (rc, stderr)

Line 199:     os.removedirs(LOCALPATH)
this should be put in a "finally" section of a "try" starting line 181.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I4d3231077fb59e11be1d61a578a96a3988559ff3
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>


More information about the vdsm-patches mailing list