Assaf Muller has posted comments on this change.

Change subject: refactor StaticSourceRoute for better testability
......................................................................


Patch Set 1: Code-Review-1

(5 comments)

http://gerrit.ovirt.org/#/c/34067/1//COMMIT_MSG
Commit Message:

Line 5: CommitDate: 2014-10-13 13:02:32 +0300
Line 6: 
Line 7: refactor StaticSourceRoute for better testability
Line 8: 
Line 9: changed the way this object is built such that most of the relevant
creattion -> creation

(Sorry for being a putz)
Line 10: information is known at object creattion time. This allows better
Line 11: testability as the routing rules and ip rules generators can be
Line 12: always accessed directly by tests.
Line 13: 


http://gerrit.ovirt.org/#/c/34067/1/tests/functional/networkTests.py
File tests/functional/networkTests.py:

Line 1617
Line 1618
Line 1619
Line 1620
Line 1621
Please don't remove these tests! We don't have coverage otherwise.


Line 328:         if routeExists(route):
Line 329:             raise self.failureException(
Line 330:                 "routing rule [%s] found. existing rules: \n%s" % (
Line 331:                     route, routeShowTable(routing_table)))
Line 332: 
The naming scheme doesn't match with the rest of the file. I would expect pep8 
to yell and shout?
Line 333:     def _get_source_routing_rules(self, deviceName, ip_addr):
Line 334:         return (StaticSourceRoute(deviceName, None, ip_addr,
Line 335:                                   IP_MASK, IP_GATEWAY))._buildRules()
Line 336: 


http://gerrit.ovirt.org/#/c/34067/1/vdsm/network/sourceroute.py
File vdsm/network/sourceroute.py:

Line 44:         self._mask = mask
Line 45:         self._gateway = gateway
Line 46:         self._table = self._generateTableId(ipaddr) if ipaddr else None
Line 47:         self._network = self._create_network(ipaddr, mask)
Line 48: 
This method is used only in the __init__ on line 47? If so I don't think it's 
needed.
Line 49:     def _create_network(self, ipaddr, mask):
Line 50:         if not ipaddr or not mask:
Line 51:             return None
Line 52:         network = netaddr.IPNetwork('%s/%s' % (ipaddr, mask))


Line 170:                         self.device)
Line 171:                 except IPRoute2Error as e:
Line 172:                     logging.error('ip binary failed during source 
route '
Line 173:                                   'removal: %s' % e.message)
Line 174: 
Changing these 3 functions to static doesn't belong in this patch.
Line 175:     @staticmethod
Line 176:     def _isLibvirtInterfaceFallback(device):
Line 177:         """
Line 178:         Checks whether the device belongs to libvirt when libvirt is 
not yet


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

Gerrit-MessageType: comment
Gerrit-Change-Id: If81c71b83670ee0c721dcce449e48ccc21e3bbec
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <[email protected]>
Gerrit-Reviewer: Assaf Muller <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to