Changeset 877


Ignore:
Timestamp:
06/12/13 12:00:14 (11 years ago)
Author:
jripsl
Message:

Fix bug (incorrect simulation_id was used in message table).

Location:
trunk/Monitoring
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Monitoring/Analyze/analyze

    r876 r877  
    7373 
    7474                                message=repo_io.retrieve_last_message(simulation) 
     75 
    7576                        except types.MessageNotFoundException, e: 
    7677 
  • trunk/Monitoring/Watch/watch

    r876 r877  
    5757        @classmethod 
    5858        def store_msg(cls,message): 
    59                 repo_io.create_message(message) 
     59 
     60                # the simu exists when we are here (see TAG0001 tag) 
     61                s=repo_io.retrieve_simulation(message.simuid) 
     62 
     63                repo_io.create_message(message,s) 
    6064 
    6165        @classmethod 
     
    127131 
    128132        # debug 
    129         mapping = { "0000":["log", "store_msg", "print_stdout", "crea_sim"], 
     133        # 
     134        # TAG0001: note that crea_sim must be BEFORE store_msg in the list (because when we insert the msg, we need the simu_id) 
     135        # 
     136        mapping = { "0000":["crea_sim", "log", "store_msg", "print_stdout"], 
    130137                                "0100":["log", "store_msg", "print_stdout", "set_sim_status_to_complete"], 
    131138                                "1000":["log", "store_msg", "print_stdout"], 
     
    138145 
    139146        # prod 
     147        # 
     148        # TAG0001: note that crea_sim must be BEFORE store_msg in the list (because when we insert the msg, we need the simu_id) 
     149        # 
    140150        """ 
    141         mapping = { "0000":["log", "store_msg", "crea_sim"], 
     151        mapping = { "0000":["crea_sim", "log", "store_msg"], 
    142152                                "0100":["log", "store_msg", "set_sim_status_to_complete"], 
    143153                                "1000":["log", "store_msg"], 
  • trunk/Monitoring/smon/local_repo.py

    r876 r877  
    140140        _conn.commit() 
    141141 
    142 def create_message(message): 
     142def create_message(message,simulation): 
    143143         
    144         _conn.execute("insert into message (simulation_id,crea_date) values (?,?)",(message.simuid, message.timestamp)) 
     144        _conn.execute("insert into message (simulation_id,crea_date) values (?,?)",(simulation.id, message.timestamp)) 
    145145 
    146146        _conn.commit() 
  • trunk/Monitoring/smon/repo_io.py

    r876 r877  
    8181 
    8282def populate_tables_with_sample(): 
     83        """ 
     84        used only by "repo-state" pgm 
     85        """ 
     86         
    8387        repo.populate_tables_with_sample() 
    8488 
    8589def retrieve_simulations(): 
     90        """ 
     91        used by get_running_simulations 
     92        """ 
    8693        return repo.retrieve_simulations() 
    8794 
     
    252259                raise Exception("ERR019 - incorrect mode") 
    253260 
    254 def create_message(message): 
    255         if mode==CSTE_MODE_LOCAL_REPO: 
    256                 repo.create_message(message) 
     261def create_message(message,simulation): 
     262        if mode==CSTE_MODE_LOCAL_REPO: 
     263                repo.create_message(message,simulation) 
    257264        elif mode==CSTE_MODE_REMOTE_REPO: 
    258265 
Note: See TracChangeset for help on using the changeset viewer.