backend/server/rhnServer/server_hardware.py | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
New commits:
commit c480546ec58bdb1af687659f2965c21fa75a5740
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Dec 5 16:14:14 2011 +0100
IPv6: store NetIfaceInformation into __hardware
diff --git a/backend/server/rhnServer/server_hardware.py b/backend/server/rhnServer/server_hardware.py
index fa310f6..85779fb 100644
--- a/backend/server/rhnServer/server_hardware.py
+++ b/backend/server/rhnServer/server_hardware.py
@@ -969,6 +969,7 @@ class Hardware:
net_iface_info = NetIfaceInformation()
net_iface_info.reload(sysid)
+ self.__hardware[NetIfaceInformation] = [net_iface_info]
# now set the flag
self.__changed = 0
commit 713a35eb7615aa2425eb239623b0277959c4de30
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Dec 5 16:09:49 2011 +0100
print better representation to help debugging
instead of:
<spacewalk.server.rhnServer.server_hardware.NetIfaceAddress4 instance at 0x8982050>
write:
<NetIfaceAddress4 Class at 203963064: {'self.db_ifaces': [{'broadcast': '10.34.35.255', 'netmask': '255.255.252.0', 'address': '10.34.34.1', 'interface_id': 127}], 'self.ifaces': {}}>
diff --git a/backend/server/rhnServer/server_hardware.py b/backend/server/rhnServer/server_hardware.py
index e9f67de..fa310f6 100644
--- a/backend/server/rhnServer/server_hardware.py
+++ b/backend/server/rhnServer/server_hardware.py
@@ -421,6 +421,15 @@ class NetIfaceInformation(Device):
vdict['ipv6'] = NetIfaceAddress6(info["ipv6"])
self.ifaces[name] = vdict
+ def __str__(self):
+ return "<%s Class at %d: %s>\n" % (
+ self.__class__.__name__,
+ id(self), {
+ "self.ifaces" : self.ifaces,
+ "self.db_ifaces" : self.db_ifaces,
+ })
+ __repr__ = __str__
+
def save(self, server_id):
log_debug(4, self.ifaces)
self.reload(server_id)
@@ -593,6 +602,15 @@ class NetIfaceAddress(Device):
vdict[mapping] = val
self.ifaces[vdict['address']] = vdict
+ def __str__(self):
+ return "<%s Class at %d: %s>\n" % (
+ self.__class__.__name__,
+ id(self), {
+ "self.ifaces" : self.ifaces,
+ "self.db_ifaces" : self.db_ifaces,
+ })
+ __repr__ = __str__
+
def cleanse_ip_addr(self, val):
""" to be overriden by child """
return val