예제 #1
0
 def __init__(self, repository, conf):
     self.log = logging.getLogger('cvmfsreplica.email')
     self.repository = repository
     self.conf = conf
     try:
         self._readadminemail()
         self._readsmtpserver()
     except:
         raise PluginConfigurationFailure('failed to initialize Email plugin')
 
     self.log.debug('plugin Email initialized properly')
예제 #2
0
 def __init__(self, repository, conf):
     self.log = logging.getLogger('cvmfsreplica.cleanup')
     self.repository = repository
     self.conf = conf
     try:
         self.CVMFS_SRV_DIRECTORY = \
              self.repository.cvmfsconf.get('CVMFS_UPSTREAM_STORAGE')\
              .split(',')[1]
     except:
         raise PluginConfigurationFailure(
             'failed to initialize Cleanup plugin')
     self.log.debug('plugin Cleanup initialized properly')
예제 #3
0
 def _readsmtpserver(self):
     # FIXME too much duplicated code in these _readXYZ() methods
     """
     get the email server host to send notifications 
     """
     try: 
         self.smtpserver = self.conf.get("report.email.smtp_server")
     except:
         # we use print so this messages goes to the stdout
         msg = "configuration variable 'smtp_server' is not defined. Plugin Email cannot be created"
         self.log.error(msg)
         raise PluginConfigurationFailure(msg)
예제 #4
0
 def _readadminemail(self):
     # FIXME too much duplicated code in these _readXYZ() methods
     """
     get the sys admin email address to send notifications 
     """
     try: 
         self.adminemail = self.conf.get("report.email.admin_email")
     except:
         # we use print so this messages goes to the stdout
         msg = "configuration variable 'admin_email' is not defined. Plugin Email cannot be created"
         self.log.error(msg)
         raise PluginConfigurationFailure(msg)
예제 #5
0
    def __init__(self, repository, conf):
        self.log = logging.getLogger('cvmfsreplica.updatedserver')
        self.repository = repository
        self.conf = conf
        try:
            self.url = self.repository.cvmfsconf.get('CVMFS_STRATUM0')
            self.reportplugins = pm.readplugins(
                self.repository, 'repository', 'report',
                self.conf.namespace('acceptance.updatedserver.', exclude=True))

        except:
            raise PluginConfigurationFailure(
                'failed to initialize Updatedserver plugin')
        self.log.debug('plugin Updatedserver initialized properly')
예제 #6
0
    def __init__(self, repository, conf):
        self.log = logging.getLogger('cvmfsreplica.nocollision')
        self.repository = repository
        self.repositoryname = self.conf.get('repositoryname')
        self.conf = conf
        try:
            self.timeout = self.conf.getint('nocollision.timeout')
            self.reportplugins = pm.readplugins(
                self.repository, 'repository', 'report',
                self.conf.namespace('acceptance.nocollision.', exclude=True))
        except:
            raise PluginConfigurationFailure(
                'failed to initialize Diskspace plugin')
        try:
            self.should_abort = self.conf.getboolean('diskspace.should_abort')
        except:
            self.should_abort = True  #Default

        self.log.debug('plugin Diskspace initialized properly')