Ondřej Svoboda has posted comments on this change.
Change subject: netinfo: Retrieve bonding options differing from defaults (WIP)
......................................................................
Patch Set 3:
(2 comments)
http://gerrit.ovirt.org/#/c/24456/3/lib/vdsm/netinfo.py
File lib/vdsm/netinfo.py:
Line 537: def _getDefaultBondingOptions():
Line 538: teeCmd = _TEE_BINARY.cmd
Line 539:
Line 540: rc, _, err = execCmd([teeCmd, BONDING_MASTERS],
Line 541: data='+' + DUMMY_BOND, sudo=True)
normal vdsm user does not have the permissions to run `sudo tee`. You
have
Written before Toni commented:
[I could exploit dd (which is in vdsm.sudoers) for writing to bonding_masters but yeah, it
sounds like a hack.
Toni ruled out supervdsm as a possibility, we do not want to call it from the library.
And after communicating with a kernel developer he told me distributions sometimes modify
the default options...]
So let's focus only on the test then. With this approach we have to read all options
to be sure no exotic ones are modified.
Line 542: if rc:
Line 543: raise OSError('Creating a reference bond failed: %s.', err)
Line 544:
Line 545: try:
Line 539:
Line 540: rc, _, err = execCmd([teeCmd, BONDING_MASTERS],
Line 541: data='+' + DUMMY_BOND, sudo=True)
Line 542: if rc:
Line 543: raise OSError('Creating a reference bond failed: %s.', err)
the err for OSError shoud be an errno. Generally it would fail due to
EEXIS
EEXISTS would mean that a previous instance of VDSM didn't remove the
bond, I think I want to know about this.
Do you mean I could somehow obtain an errno, in addition to a useless return code and
strerror(errno) if I read the command' stderr?
Line 544:
Line 545: try:
Line 546: opts = bondOpts(DUMMY_BOND)
Line 547: finally:
--
To view, visit
http://gerrit.ovirt.org/24456
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ief6d366b1b761627c7203cf236b75ef538af3e26
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes