Change in vdsm[master]: Extend setupNetworks API to accept defaultRoute

danken at redhat.com danken at redhat.com
Mon Jan 13 21:39:02 UTC 2014


Dan Kenigsberg has posted comments on this change.

Change subject: Extend setupNetworks API to accept defaultRoute
......................................................................


Patch Set 2:

(2 comments)

http://gerrit.ovirt.org/#/c/22720/2/lib/vdsm/tool/unified_persistence.py
File lib/vdsm/tool/unified_persistence.py:

Line 29: 
Line 30: UPGRADE_NAME = 'UnifiedPersistence'
Line 31: 
Line 32: 
Line 33: # TODO: Upgrade currently gets bootproto from ifcfg files,
> It has nothing to do with this patch, you're right. I got carried away :)
Confusing... An "upgrade" that is required to run on a clean install, too. I suppose that a doc about this should appear somewhere.
Line 34: # as we assume we're upgrading from oVirt <= 3.4, where users still used
Line 35: # ifcfg files. Once we start dealing with new installations on OS that don't
Line 36: # use ifcfg files, we need to stop getting information from ifcfg files.
Line 37: # bootproto = 'dhcp' if there's a lease on the NIC at the moment of upgrade


Line 97:                 if netParams['gateway'] != '':
Line 98:                     networks[network]['gateway'] = netParams['gateway']
Line 99: 
Line 100:             networks[network]['defaultRoute'] = \
Line 101:                 str(network in MANAGEMENT_NETWORKS)
> If you serialize True to json, it is for whatever reason converted to true 
Oh dear, I see that

  json.loads(json.dumps({True: False})) == {u'True': False}

Note that when it comes to values, not keys, Booleans are conserved. It is not clear to me why this extra level of serialization needed here.

Nevertheless, I note that this is prevalent in this module. So let us figure this out in a future patch.
Line 102: 
Line 103:             # What if the 'physical device' is actually a VLAN?
Line 104:             if physicalDevice in netinfo.vlans:
Line 105:                 vlanDevice = physicalDevice


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9b2ff711155eb0bd79ab84e979eb82c846362374
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list