コード例 #1
0
 def save(self, raise_on_error=False):
     # There is no concurrency, so does not need to be done atomically
     # Anyway we want to avoid to write an empty file on top of a saved state because of an exception
     try:
         util.file_pickle_dump(self.fname, self.data)
     except:
         if raise_on_error:
             raise
コード例 #2
0
 def save(self, raise_on_error=False):
     # There is no concurrency, so does not need to be done atomically
     # Anyway we want to avoid to write an empty file on top of a
     # saved state because of an exception
     try:
         util.file_pickle_dump(self.fname, self.data)
     except:
         if raise_on_error:
             raise
コード例 #3
0
ファイル: glideFactory.py プロジェクト: mambelli/glideinwms
def save_stats(stats, fname):
    """ Serialize and save aggregated statistics so that each component (Factory and Entries)
    can retrieve and use it to log and advertise

    stats is a dictionary pickled in binary format
    stats['LogSummary'] - log summary aggregated info

    :param stats: aggregated Factory statistics
    :param fname: name of the file with the serialized data
    :return:
    """
    util.file_pickle_dump(fname, stats,
                          mask_exceptions=(logSupport.log.exception, "Saving of aggregated statistics failed: "))
コード例 #4
0
ファイル: glideFactory.py プロジェクト: glideinWMS/glideinWMS
def save_stats(stats, fname):
    """ Serialize and save aggregated statistics so that each component (Factory and Entries)
    can retrieve and use it to log and advertise

    stats is a dictionary pickled in binary format
    stats['LogSummary'] - log summary aggregated info

    :param stats: aggregated Factory statistics
    :param fname: name of the file with the serialized data
    :return:
    """
    util.file_pickle_dump(fname, stats,
                          mask_exceptions=(logSupport.log.exception, "Saving of aggregated statistics failed: "))
コード例 #5
0
 def save(self):
     """save self.config_data into self.config_fname"""
     # tmp file name is now *.PID.tmp instead of *~
     util.file_pickle_dump(self.config_fname, self.config_data, protocol=0)  # use ASCII version of protocol
     return
コード例 #6
0
 def save(self):
     """save self.config_data into self.config_fname"""
     # tmp file name is now *.PID.tmp instead of *~
     util.file_pickle_dump(self.config_fname, self.config_data,
                           protocol=0)  # use ASCII version of protocol
     return