Antoni Segura Puimedon has posted comments on this change.
Change subject: Simplify netinfo get.
......................................................................
Patch Set 10: (2 inline comments)
....................................................
File vdsm/netinfo.py
Line 282: if bridged:
Line 283: data.update({'ports': ports(iface), 'stp':
bridge_stp_state(iface),
Line 284: 'cfg': getIfaceCfg(iface)})
Line 285: else:
Line 286: # ovirt-engine-3.1 expects to see the "interface"
attribute iff the
I think this comment is consistent with the code.
http://en.wikipedia.org/wiki/If_and_only_if#Origin_of_iff
If we would change it to just "if" it would mean that interface could also be
put to the bridged case and the else could be dropped.
Line 287: # network is bridgeless. Please remove the attribute and
this
Line 288: # comment when the version is no longer supported.
Line 289: data['interface'] = iface
Line 290: data.update({'iface': iface, 'bridged': bridged,
Line 292: 'gateway': routes.get(iface, '0.0.0.0'),
Line 293: 'mtu': getMtu(iface)})
Line 294: except OSError as e:
Line 295: if e.errno == errno.ENOENT:
Line 296: logging.info('Obtaining info for net %s.', iface,
exc_info=True)
It would be more accurate. My only concert is: Should I also rename the method
to "_getIfaceInfo"?
Line 297: raise KeyError('Network %s was not found' % iface)
Line 298: else:
Line 299: raise
Line 300: return data
--
To view, visit http://gerrit.ovirt.org/11080
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I5c3e617d10308d0bfa4deaed329b2e10ef54077c
Gerrit-PatchSet: 10
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Igor Lvovsky <[email protected]>
Gerrit-Reviewer: Livnat Peer <[email protected]>
Gerrit-Reviewer: Mark Wu <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches