Ido Barkan has posted comments on this change.

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


Patch Set 1:

(4 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
Done
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.
those test nothing that isn't already tested by testSetupNetworksAddDelDhcp or 
testStaticSourceRouting


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
IMO this is definitely too much logic to be including directly in the __init__. 
I like __init__ method to be concise but It's a matter of taste I guess.
I would have changed it's name though but I couldn't come out with something 
better.
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.
This is a result of the change done in sourceroutethread.py:44
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: Ido Barkan <[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