[node-patches] Change in ovirt-node[master]: abstract "/etc/sysconfig/network-scripts" to a path const va...

fabiand at fedoraproject.org fabiand at fedoraproject.org
Tue Nov 5 09:38:10 UTC 2013


Fabian Deutsch has posted comments on this change.

Change subject: abstract "/etc/sysconfig/network-scripts" to a path const value.
......................................................................


Patch Set 4: Code-Review-1

(1 comment)

Hey Hai,

Sorry for the late reply.

I really like this idea, but here is my suggestion on the implementation:

Let us use `src/ovirt/node/config/__init__.py.in` and integrate it into the buildsystem, then we can set the network path at build time using a configure switch. This will also allow us to pass other informations more easily (from the buildsystem to the code).

More comments inline.

....................................................
File src/ovirt/node/config/network.py
Line 112:     def list():
Line 113:         return NicConfig._backend_type.list()
Line 114: 
Line 115:     class IfcfgBackend(ShellVarFile):
Line 116:         filename_tpl = NetworkConst.NETWORK_SCRIPTS_PATH + "/ifcfg-%s"
Please define a function somewhere for this repitive task to build paths for an ifcfg file, e.g.:

   def ifcfg_path(ifname):
       return os.path.join(config.NETWORK_SCRIPTS_PATH, "ifcfg-" + ifname)


And use this function where needed.
Line 117:         filename = None
Line 118: 
Line 119:         def __init__(self, cfg, ifname):
Line 120:             self.cfg = cfg


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I4304f5eabcc1f8b547cdb076b836607a6009468f
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hai bo <boh.ricky at gmail.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at fedoraproject.org>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes



More information about the node-patches mailing list