Author: justi9
Date: 2008-06-02 20:45:18 -0400 (Mon, 02 Jun 2008)
New Revision: 2111
Modified:
mgmt/cumin/python/cumin/model.py
Log:
bz446958 - Format the binary system UUID as something more readable
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-06-02 22:41:32 UTC (rev 2110)
+++ mgmt/cumin/python/cumin/model.py 2008-06-03 00:45:18 UTC (rev 2111)
@@ -5,6 +5,7 @@
from datetime import datetime, timedelta
from types import *
from logging import getLogger
+from struct import unpack
from util import *
from formats import *
@@ -453,7 +454,7 @@
def __init__(self, model):
super(CuminSystem, self).__init__(model, "system", System,
SystemStats)
- prop = CuminProperty(self, "sysId")
+ prop = self.SystemIdProperty(self, "systemId")
prop.title = "System ID"
prop = CuminProperty(self, "nodeName")
@@ -488,6 +489,12 @@
def get_object_name(self, object):
return object.nodeName
+ class SystemIdProperty(CuminProperty):
+ def value(self, object):
+ val = super(CuminSystem.SystemIdProperty, self).value(object)
+
+ return "%08x-%04x-%04x-%04x-%04x%08x" % unpack("!LHHHHL",
val)
+
class CuminBroker(RemoteClass):
def __init__(self, model):
super(CuminBroker, self).__init__(model, "broker", Broker,
BrokerStats)
Show replies by date