<commit_before>""" Module to handle attributes related to the lsf jobmanager 
configuration """

import os
import re
import logging

from osg_configure.modules import utilities
from osg_configure.modules import configfile
from osg_configure.modules import validation
from osg_configure.modules.jobmanagerbase import JobManagerConfiguration

__all__ = ['LSFConfiguration']


class LSFConfiguration(JobManagerConfiguration):
  """Class to handle attributes related to lsf job manager configuration"""
  
  LSF_CONFIG_FILE = '/etc/grid-services/available/jobmanager-lsf-seg'
  GRAM_CONFIG_FILE = '/etc/globus/globus-lsf.conf'

  def __init__(self, *args, **kwargs):
    # pylint: disable-msg=W0142
    super(LSFConfiguration, self).__init__(*args, **kwargs)    
    self.log('LSFConfiguration.__init__ started')    
    # dictionary to hold information about options
    self.options = {'lsf_location' : 
                      configfile.Option(name = 'lsf_location',
                                        default_value = '/usr',
                                        mapping = 'OSG_LSF_LOCATION'),
                    'lsf_profile' : 
                      configfile.Option(name = 'lsf_profile'),
                    'job_contact' : 
                      configfile.Option(name = 'job_contact',
                                        mapping = 'OSG_JOB_CONTACT'),
                    'util_contact' : 
                      configfile.Option(name = 'util_contact',
                                        mapping = 'OSG_UTIL_CONTACT'),
                    'seg_enabled' : 
                      configfile.Option(name = 'seg_enabled',
                                        required = configfile.Option.OPTIONAL,
                                        opt_type = bool,
                                        default_value = False),
                    'log_directory' : 
                      configfile.Option(name = 'log_directory',
                                        required = configfile.Option.OPTIONAL,
                                        default_value = ''),
                    'accept_limited' : configfile.Option(name = 'accept_limited',
                                                      required = configfile.Option.OPTIONAL,
                                                      opt_type = bool,
                                                      default_value = False)}    
    self.config_section = 'LSF'
    self.__set_default = True

    self.log('LSFConfiguration.__init__ completed')    
      
  def parseConfiguration(self, configuration):
    """Try to get configuration information from ConfigParser or SafeConfigParser object given
    by configuration and write recognized settings to attributes dict
    """<commit_msg>Fix for SOFTWARE-1208<commit_after>""" Module to handle attributes related to the lsf jobmanager 
configuration """

import os
import re
import logging

from osg_configure.modules import utilities
from osg_configure.modules import configfile
from osg_configure.modules import validation
from osg_configure.modules.jobmanagerbase import JobManagerConfiguration

__all__ = ['LSFConfiguration']


class LSFConfiguration(JobManagerConfiguration):
  """Class to handle attributes related to lsf job manager configuration"""
  
  LSF_CONFIG_FILE = '/etc/grid-services/available/jobmanager-lsf-seg'
  GRAM_CONFIG_FILE = '/etc/globus/globus-lsf.conf'

  def __init__(self, *args, **kwargs):
    # pylint: disable-msg=W0142
    super(LSFConfiguration, self).__init__(*args, **kwargs)    
    self.log('LSFConfiguration.__init__ started')    
    # dictionary to hold information about options
    self.options = {'lsf_location' : 
                      configfile.Option(name = 'lsf_location',
                                        default_value = '/usr',
                                        mapping = 'OSG_LSF_LOCATION'),
                    'lsf_profile' : 
                      configfile.Option(name = 'lsf_profile',
                                        default_value = ''),
                    'job_contact' : 
                      configfile.Option(name = 'job_contact',
                                        mapping = 'OSG_JOB_CONTACT'),
                    'util_contact' : 
                      configfile.Option(name = 'util_contact',
                                        mapping = 'OSG_UTIL_CONTACT'),
                    'seg_enabled' : 
                      configfile.Option(name = 'seg_enabled',
                                        required = configfile.Option.OPTIONAL,
                                        opt_type = bool,
                                        default_value = False),
                    'log_directory' : 
                      configfile.Option(name = 'log_directory',
                                        required = configfile.Option.OPTIONAL,
                                        default_value = ''),
                    'accept_limited' : configfile.Option(name = 'accept_limited',
                                                      required = configfile.Option.OPTIONAL,
                                                      opt_type = bool,
                                                      default_value = False)}    
    self.config_section = 'LSF'
    self.__set_default = True

    self.log('LSFConfiguration.__init__ completed')    
      
  def parseConfiguration(self, configuration):
    """Try to get configuration information from ConfigParser or SafeConfigParser object given
    by configuration and write recognized settings to attributes dict
    """
{'fraction_non_alphanumeric': 0.07619557458957887, 'fraction_numerical': 0.0021413276231263384, 'mean_word_length': 1.5259125732311851, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 31, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4808668', 'n_tokens_mistral': 1261, 'n_tokens_neox': 1212, 'n_words': 287}