]> git.ipfire.org Git - oddments/fireinfo.git/commitdiff
Add network information to profile.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 27 Dec 2010 17:06:21 +0000 (18:06 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 27 Dec 2010 17:06:21 +0000 (18:06 +0100)
fireinfo/system.py

index 862aace762cfc846a4e4bd546c95393c15bbbadf..d711ba0127c468180808be157a406b3ce87e9413 100644 (file)
@@ -29,6 +29,7 @@ import _fireinfo
 import cpu
 import device
 import hypervisor
+import network
 
 PROFILE_VERSION = 0
 
@@ -129,6 +130,13 @@ class System(object):
                        "count" : self.cpu.count                                
                }
 
+               p["network"] = {
+                       "green" : self.network.has_green(),
+                       "blue" : self.network.has_blue(),
+                       "orange" : self.network.has_orange(),
+                       "red" : self.network.has_red(),
+                }
+
                # Only append hypervisor information if we are virtualized.
                if self.virtual:
                        p["hypervisor"] = {
@@ -379,7 +387,13 @@ class System(object):
                """
                return self.hypervisor.virtual
 
-               
+       @property
+       def network(self):
+               """
+                       Reference to the network class.
+               """
+               return network.Network()
+
 
 if __name__ == "__main__":
        s=System()