Ejemplo n.º 1
0
def loadconfig(configfile):
    try:
        c = Config()
        c.read_config_silent = 1
        r = c.read_config(configfile)
        b = c.read_config_buf(r)
        return (True, b)
    except:
        return (False, "There was an error reading the configuration file")
Ejemplo n.º 2
0
def loadconfig(configfile):
    try:
        c = Config()
        c.read_config_silent = 1
        r = c.read_config(configfile)
        b = c.read_config_buf(r)
        return (True, b)
    except:
        return (False, "There was an error reading the configuration file")
Ejemplo n.º 3
0
 def loadconfig(self):
     try:
         c=Config()
         c.read_config_silent=1
         r=c.read_config(self.configfile)
         self.config=c.read_config_buf(r)
         return (True,"Config loaded") 
     except:
         return (False,"There was an error reading the configuration file")
Ejemplo n.º 4
0
    def getconf(self, config):
        '''
        Get the data in the arbiter for a table and some properties
        like hosts  host_name realm
        '''
        files = [config]
        conf = Config()
        conf.read_config_silent = 1

        # Get hosts objects
        properties = [ 'host_name','use','act_depend_of']
        hosts = self.arb.get_objects_properties('hosts', properties)

        # Get services dependencies
        svcdep_buf = conf.read_config(files)
        svc_dep = conf.read_config_buf(svcdep_buf)['servicedependency']

        return (hosts, svc_dep)
    def getconf(self, config):
        '''
        Get the data in the arbiter for a table and some properties
        like hosts  host_name realm
        '''
        files = [config]
        conf = Config()
        conf.read_config_silent = 1

        # Get hosts objects
        properties = ['host_name', 'use', 'act_depend_of']
        hosts = self.arb.get_objects_properties('hosts', properties)

        # Get services dependencies
        svcdep_buf = conf.read_config(files)
        svc_dep = conf.read_config_buf(svcdep_buf)['servicedependency']

        return (hosts, svc_dep)
    def getconf(self, config):
        """
        Get the data in the arbiter for a table and some properties
        like hosts  host_name realm
        """
        files = [config]
        conf = Config()
        conf.read_config_silent = 1

        # Get hosts objects
        properties = ["host_name", "use", "act_depend_of"]
        hosts = self.arb.get_objects_properties("hosts", properties)

        # Get services dependencies
        svcdep_buf = conf.read_config(files)
        svc_dep = conf.read_config_buf(svcdep_buf)["servicedependency"]

        return (hosts, svc_dep)