Changeset 496

Show
Ignore:
Timestamp:
05/27/08 13:22:07 (8 months ago)
Author:
jmowery
Message:

added get messages and get status code to manager

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/trunk-pmd-intproto/server/master.py

    r495 r496  
    266266                                        ''' 
    267267                                        val.type = "response" 
    268                                         ### FIXME: Jeremy, how do I get all messages out of the 
    269                                         ### store, I need [(IP, [msgs])], Is this going to be 
    270                                         ### disrupted 
    271                                         res = self.filtermsgs(storage.getallmsgs(), val.body) 
     268                                        root_layer = storage.Layer(storage_root) 
     269                                        all_messages = [root_layer.get_log_messages(x) for x in root_layer.list_nodes()] 
     270                                        root_layer.update() 
     271                                        res = self.filtermsgs(all_messages, val.body) 
    272272                                elif val.msg == "client status": 
    273                                         ''' FIXME: Jeremy add the code to handle the message 
    274                                            you added to mgmt/manager.py here.  ''' 
    275                                         pass 
     273                                        val.type = 'response' 
     274                                        status_list = [] 
     275                                        for client_id in val.body: 
     276                                                client_node = storage.Node(client_id, storage_root) 
     277                                                status_list.append((client_id, client_node.enforcing)) 
     278                                                client_node.update() 
     279                                        val.body = status_list 
     280                                        res = val 
    276281                                else: 
    277282                                        res = self.comm(ret2, val, (mgr, info))