Signed-off-by: Sage Weil <sage@redhat.com>
# Service status description when status == -1.
self.status_desc = status_desc
+ def name(self):
+ if self.service_instance:
+ return '%s.%s' % (self.service_type, self.service_instance)
+ return self.service_type
+
def to_json(self):
out = {
'nodename': self.nodename,
table.align = 'l'
table.left_padding_width = 0
table.right_padding_width = 1
- for s in services:
+ for s in sorted(services, key=lambda s: s.name()):
if s.service is None:
service_id = s.service_instance
else: