Nir Soffer has posted comments on this change.

Change subject: context manager for dhclient in functional tests
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.ovirt.org/#/c/34366/2/tests/functional/dhcp.py
File tests/functional/dhcp.py:

Line 85:     def _create_conf(self):
Line 86:         with open(self._conf_file, 'w') as f:
Line 87:             f.write('db-time-format {0};'.format(self._date_format))
Line 88: 
Line 89:     def run(self):
Run is best use for starting a process and waiting for it. Here you seem to 
*start* the process, so this should be named start().

Now if you also rename kill() to stop(), you can drop the context manager, and 
use utils.running:

    dr = _DhclientRunner(...)
    with utils.running(dr):
        ...
Line 90:         rc, out, err = execCmd([_DHCLIENT_BINARY.cmd, '-v', '-lf',
Line 91:                                 self.lease_file, '-pf', self._pid_file,
Line 92:                                 '-timeout', str(_DHCLIENT_TIMEOUT), 
'-1',
Line 93:                                 '-cf', self._conf_file, 
self._interface])


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I458aa38415c697d3863e173444ff921d759166a2
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibar...@redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegu...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Ido Barkan <ibar...@redhat.com>
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
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