commit 372408de22a494b973f39901228ee30353c1baa9
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Jul 25 11:57:06 2012 +0200
NetTestParse: Changing 'netdevice' to 'interface'
This patch changes the name of 'netdevice' tag within 'netconfig'
to 'interface' to make it more distinguishable from 'netdevice' tag
that is also present within 'netmachineconfig', but with a little
different semantics. I posted more in-depth description of this
to the lnst-developers list [1].
This change should help users to understand the XML recipes better.
I also tried shorter 'iface' instead of 'interface' (as we discussed
at the meeting), but in my opinion it doesn't fit there right. None
of the other tag names is abbreviated and 'interface' is 9 chars long,
which is exactly the same as the previous 'netdevice'.
Here's an example:
<netconfig>
<interface id="1" phys_id="1"
type="eth"/>
<interface id="2" phys_id="2"
type="eth"/>
<interface id="3" type="bond">
<options>
<option name="mode" value="0" />
<option name="miimon" value="100" />
</options>
<slaves>
<slave id="1"/>
<slave id="2"/>
</slaves>
<addresses>
<address value="192.168.122.3/24" />
</addresses>
</interface>
</netconfig>
[1]
https://fedorahosted.org/pipermail/lnst-developers/2012-July/000219.html
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
NetTest/NetTestParse.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/NetTest/NetTestParse.py b/NetTest/NetTestParse.py
index 7869cd0..e52f0f3 100644
--- a/NetTest/NetTestParse.py
+++ b/NetTest/NetTestParse.py
@@ -119,7 +119,7 @@ class NetMachineConfigParse(RecipeParser):
def parse(self, node):
scheme = {"info": self._info,
- "netdevice": self._phys_netdevice}
+ "netdevice": self._netdevice}
self._process_child_nodes(node, scheme)
def _info(self, node, params):
@@ -139,7 +139,7 @@ class NetMachineConfigParse(RecipeParser):
self._trigger_event("machine_info_ready",
{"machine_id": self._machine_id})
- def _phys_netdevice(self, node, params):
+ def _netdevice(self, node, params):
machine = self._machine
phys_id = self._get_attribute(node, "phys_id", int)
@@ -169,10 +169,10 @@ class NetConfigParse(RecipeParser):
devices = self._machine["netdevices"]
self._devices = devices
- scheme = {"netdevice": self._netdevice}
+ scheme = {"interface": self._interface}
self._process_child_nodes(node, scheme)
- def _netdevice(self, node, params):
+ def _interface(self, node, params):
netconfig = self._netconfig
devices = self._devices