Change in vdsm[master]: Unified network persistence [3/3] - Restore network configur...

gvallare at redhat.com gvallare at redhat.com
Wed Aug 14 20:27:58 UTC 2013


Giuseppe Vallarelli has posted comments on this change.

Change subject: Unified network persistence [3/3] - Restore network configuration
......................................................................


Patch Set 2: Code-Review-1

(2 comments)

....................................................
File vdsm/vdsm-restore-net-config
Line 27: from vdsm import netinfo
Line 28: from configNetwork import setupNetworks
Line 29: 
Line 30: 
Line 31: def ifcfg_restoration():
Of course I don't agree on having this behaviour in a different script.
We got now if config.get('vars', 'persistence') == 'unified' 6..
Including the ones in the first patch of the series.
Line 32:     configWriter = ifcfg.ConfigWriter()
Line 33:     configWriter.restorePersistentBackup()
Line 34: 
Line 35: 


Line 40:     """
Line 41:     nets = {}
Line 42:     bonds = {}
Line 43:     for netFile in os.listdir(netinfo.NET_CONF_PERS_DIR):
Line 44:         nets[os.path.basename(netFile)] = json.load(open(netFile))
By looking at the usage of the json module we only use json for convenience there are no real requirements for the json format, so at this point why don't we use the pickle module which serve for this exact purpose.
Line 45: 
Line 46:     for bondFile in os.listdir(netinfo.BOND_CONF_PERS_DIR):
Line 47:         bonds[os.path.basename(bondFile)] = json.load(open(bondFile))
Line 48:     setupNetworks(nets, bonds)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I73462b160ecfbaa7efe71eed905a3bbd69ee6c23
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: Giuseppe Vallarelli <gvallare at redhat.com>
Gerrit-Reviewer: Livnat Peer <lpeer at redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: Petr Ĺ ebek <psebek at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list