Exemple #1
0
   def __init__(self, config_parser, **kwargs): 
       """Initialize BluePrint Agent.
 
       'config_parser' represents the agent config file.
       **kwargs holds anything that can't be sent in config_parser.
       """
       BaseAgent.__init__(self, config_parser)
Exemple #2
0
    def __init__(self, config_parser):
        BaseAgent.__init__(self, config_parser)

        role.init(config_parser)

        self.VAR_TMP = config_parser.get('agent', 'VAR_TMP')
        self.VAR_CACHE = config_parser.get('agent', 'VAR_CACHE')
        self.VAR_RUN = config_parser.get('agent', 'VAR_RUN')

        self.webserver_file = join(self.VAR_TMP, 'web-php.pickle')
        self.webservertomcat_file = join(self.VAR_TMP, 'web-tomcat.pickle')
        self.httpproxy_file = join(self.VAR_TMP, 'proxy.pickle')
        self.php_file = join(self.VAR_TMP, 'php.pickle')
        self.tomcat_file = join(self.VAR_TMP, 'tomcat.pickle')

        self.web_lock = Lock()
        self.webservertomcat_lock = Lock()
        self.httpproxy_lock = Lock()
        self.php_lock = Lock()
        self.tomcat_lock = Lock()

        self.WebServer = role.NginxStatic
        self.HttpProxy = role.NginxProxy

        if self.ganglia:
            self.ganglia.add_modules(('nginx_mon', 'nginx_proxy_mon',
                                      'php_fpm_mon'))
Exemple #3
0
    def __init__(self,
                 config_parser, # config file
                 **kwargs):     # anything you can't send in config_parser
                                # (hopefully the new service won't need anything extra)
        BaseAgent.__init__(self, config_parser)
        role.init(config_parser)

        self.VAR_TMP = config_parser.get('agent', 'VAR_TMP')
        self.dir_file = join(self.VAR_TMP, 'dir.pickle')
        self.mrc_file = join(self.VAR_TMP, 'mrc.pickle')
        self.osd_file = join(self.VAR_TMP, 'osd.pickle')

        self.CERTS_PATH = config_parser.get('agent', 'CERTS_PATH')
        self.DIR_CERT_PATH = join(self.CERTS_PATH,
                config_parser.get('dir', 'DIR_CERT'))
        self.MRC_CERT_PATH = join(self.CERTS_PATH,
                config_parser.get('mrc', 'MRC_CERT'))
        self.OSD_CERT_PATH = join(self.CERTS_PATH,
                config_parser.get('osd', 'OSD_CERT'))
        self.TRUSTED_CA_PATH = join(self.CERTS_PATH,
                config_parser.get('agent', 'TRUSTED_CA'))

        self.mrc_lock = Lock()
        self.dir_lock = Lock()
        self.osd_lock = Lock()

        self.DIR = role.DIR
        self.MRC = role.MRC
        self.OSD = role.OSD
Exemple #4
0
 def __init__(
         self,
         config_parser,  # config file
         **kwargs):  # anything you can't send in config_parser
     # (hopefully the new service won't need anything extra)
     BaseAgent.__init__(self, config_parser)
     self.gen_string = config_parser.get('agent', 'STRING_TO_GENERATE')
Exemple #5
0
    def __init__(self, config_parser):
        BaseAgent.__init__(self, config_parser)

        role.init(config_parser)

        self.VAR_TMP = config_parser.get('agent', 'VAR_TMP')
        self.VAR_CACHE = config_parser.get('agent', 'VAR_CACHE')
        self.VAR_RUN = config_parser.get('agent', 'VAR_RUN')

        self.webserver_file = join(self.VAR_TMP, 'web-php.pickle')
        self.webservertomcat_file = join(self.VAR_TMP, 'web-tomcat.pickle')
        self.httpproxy_file = join(self.VAR_TMP, 'proxy.pickle')
        self.php_file = join(self.VAR_TMP, 'php.pickle')
        self.tomcat_file = join(self.VAR_TMP, 'tomcat.pickle')

        self.web_lock = Lock()
        self.webservertomcat_lock = Lock()
        self.httpproxy_lock = Lock()
        self.php_lock = Lock()
        self.tomcat_lock = Lock()

        self.WebServer = role.NginxStatic
        self.HttpProxy = role.NginxProxy

        if self.ganglia:
            self.ganglia.add_modules(
                ('nginx_mon', 'nginx_proxy_mon', 'php_fpm_mon'))
Exemple #6
0
    def test_check_agent_process(self):
        test_agent = BaseAgent(self.config_parser)

        error_res = test_agent.check_agent_process({'argument': 42})
        self.assertEquals(HttpErrorResponse, type(error_res))

        json_res = test_agent.check_agent_process({})
        self.assertEquals(HttpJsonResponse, type(json_res))
Exemple #7
0
 def __init__(self, config_parser, **kwargs):  # config file  # anything you can't send in config_parser
     # (hopefully the new service won't need anything extra)
     BaseAgent.__init__(self, config_parser)
     self.config_template = join(ETC, "scalaris.local.cfg.tmpl")
     self.config_file = join(ETC, "scalaris.local.cfg")
     self.first_node = config_parser.get("agent", "FIRST_NODE")
     self.known_hosts = config_parser.get("agent", "KNOWN_HOSTS")
     self.mgmt_server = config_parser.get("agent", "MGMT_SERVER")
Exemple #8
0
 def __init__(self,
              config_parser, # config file
              **kwargs):     # anything you can't send in config_parser
                             # (hopefully the new service won't need anything extra)
   BaseAgent.__init__(self, config_parser)
   self.first_node = config_parser.get('agent', 'FIRST_NODE')
   self.mgmt_server = config_parser.get('agent', 'MGMT_SERVER')
   self.logger.info("Init done: first_node=%s, mgmt_server=%s", self.first_node, self.mgmt_server)
Exemple #9
0
 def __init__(self,
              config_parser, # config file
              **kwargs):     # anything you can't send in config_parser
                             # (hopefully the new service won't need anything extra)
   BaseAgent.__init__(self, config_parser)
   self.config_template = join(ETC, 'scalaris.local.cfg.tmpl')
   self.config_file = join(ETC, 'scalaris.local.cfg')
   self.first_node = config_parser.get('agent', 'FIRST_NODE')
   self.known_hosts = config_parser.get('agent', 'KNOWN_HOSTS')
   self.mgmt_server = config_parser.get('agent', 'MGMT_SERVER')
Exemple #10
0
 def __init__(
         self,
         config_parser,  # config file
         **kwargs):  # anything you can't send in config_parser
     # (hopefully the new service won't need anything extra)
     BaseAgent.__init__(self, config_parser)
     self.config_template = join(ETC, 'scalaris.local.cfg.tmpl')
     self.config_file = join(ETC, 'scalaris.local.cfg')
     self.first_node = config_parser.get('agent', 'FIRST_NODE')
     self.known_hosts = config_parser.get('agent', 'KNOWN_HOSTS')
     self.mgmt_server = config_parser.get('agent', 'MGMT_SERVER')
Exemple #11
0
    def __init__(self, config_parser):
        BaseAgent.__init__(self, config_parser)
        self.config_parser = config_parser

        self.my_ip = config_parser.get('agent', 'MY_IP')
        self.VAR_TMP = config_parser.get('agent', 'VAR_TMP')
        self.VAR_CACHE = config_parser.get('agent', 'VAR_CACHE')
        self.VAR_RUN = config_parser.get('agent', 'VAR_RUN')

        self.master_file = join(self.VAR_TMP, 'master.pickle')
        self.slave_file = join(self.VAR_TMP, 'slave.pickle')

        self.master_lock = Lock()
        self.slave_lock = Lock()
Exemple #12
0
    def __init__(self, config_parser, **kwargs): 
        """Initialize BluePrint Agent.
  
        'config_parser' represents the agent config file.
        **kwargs holds anything that can't be sent in config_parser.
        """
        BaseAgent.__init__(self, config_parser)

        # Path to the BluePrint JAR file
        self.blueprint_dir = config_parser.get('agent', 'CONPAAS_HOME')
  
        # The following two variables have the same value on the Hub
        self.my_ip_address = None
        self.hub_ip_address = None
Exemple #13
0
    def __init__(self, config_parser):
        BaseAgent.__init__(self, config_parser)
        self.config_parser = config_parser

        self.my_ip = config_parser.get('agent', 'MY_IP')
        self.VAR_TMP = config_parser.get('agent', 'VAR_TMP')
        self.VAR_CACHE = config_parser.get('agent', 'VAR_CACHE')
        self.VAR_RUN = config_parser.get('agent', 'VAR_RUN')

        self.master_file = join(self.VAR_TMP, 'master.pickle')
        self.slave_file = join(self.VAR_TMP, 'slave.pickle')

        self.master_lock = Lock()
        self.slave_lock = Lock()
Exemple #14
0
    def __init__(self, config_parser, **kwargs):
        """Initialize HTC Agent.
  
        'config_parser' represents the agent config file.
        **kwargs holds anything that can't be sent in config_parser.
        """
        BaseAgent.__init__(self, config_parser)

        # Path to the HTC JAR file
        self.htc_dir = config_parser.get('agent', 'CONPAAS_HOME')

        # The following two variables have the same value on the Hub
        self.my_ip_address = None
        self.hub_ip_address = None
Exemple #15
0
    def __init__(self, config_parser, **kwargs):
        """Initialize Generic Agent.

        'config_parser' represents the agent config file.
        **kwargs holds anything that can't be sent in config_parser.
        """
        BaseAgent.__init__(self, config_parser)

        self.SERVICE_ID = config_parser.get('agent', 'SERVICE_ID')
        self.GENERIC_DIR = config_parser.get('agent', 'CONPAAS_HOME')
        self.VAR_CACHE = config_parser.get('agent', 'VAR_CACHE')
        self.CODE_DIR = join(self.VAR_CACHE, 'bin')
        self.VOLUME_DIR = '/media'
        self.env = {}
        self.processes = {}
Exemple #16
0
    def __init__(self, config_parser):
        BaseAgent.__init__(self, config_parser)
        self.config_parser = config_parser

        self.my_ip = config_parser.get("agent", "MY_IP")
        self.VAR_TMP = config_parser.get("agent", "VAR_TMP")
        self.VAR_CACHE = config_parser.get("agent", "VAR_CACHE")
        self.VAR_RUN = config_parser.get("agent", "VAR_RUN")

        self.mysqld_file = join(self.VAR_TMP, "mysqld.pickle")

        self.lock = Lock()

        # list of roles running in this agent
        self.running_roles = []
Exemple #17
0
    def __init__(self, config_parser):
        BaseAgent.__init__(self, config_parser)
        self.config_parser = config_parser

        self.my_ip = config_parser.get('agent', 'MY_IP')
        self.VAR_TMP = config_parser.get('agent', 'VAR_TMP')
        self.VAR_CACHE = config_parser.get('agent', 'VAR_CACHE')
        self.VAR_RUN = config_parser.get('agent', 'VAR_RUN')

        self.mysqld_file = join(self.VAR_TMP, 'mysqld.pickle')

        self.lock = Lock()

        # list of roles running in this agent
        self.running_roles = []
Exemple #18
0
    def __init__(self,
                 config_parser, # config file
                 **kwargs):     # anything you can't send in config_parser 
                                # (hopefully the new service won't need anything extra)
        BaseAgent.__init__(self, config_parser)
        role.init(config_parser)
        self.gen_string = config_parser.get('agent','STRING_TO_GENERATE')
        
        self.VAR_TMP = config_parser.get('agent','VAR_TMP')

        self.dir_file = join(self.VAR_TMP,'dir.pickle')
        self.mrc_file = join(self.VAR_TMP,'mrc.pickle')
        self.osd_file = join(self.VAR_TMP,'osd.pickle')
        self.mrc_lock = Lock()
        self.dir_lock = Lock()
        self.osd_lock = Lock()

        self.DIR = role.DIR
        self.MRC = role.MRC
        self.OSD = role.OSD
Exemple #19
0
    def __init__(
            self,
            config_parser,  # config file
            **kwargs):  # anything you can't send in config_parser
        # (hopefully the new service won't need anything extra)
        BaseAgent.__init__(self, config_parser)
        role.init(config_parser)
        self.gen_string = config_parser.get('agent', 'STRING_TO_GENERATE')

        self.VAR_TMP = config_parser.get('agent', 'VAR_TMP')

        self.dir_file = join(self.VAR_TMP, 'dir.pickle')
        self.mrc_file = join(self.VAR_TMP, 'mrc.pickle')
        self.osd_file = join(self.VAR_TMP, 'osd.pickle')
        self.mrc_lock = Lock()
        self.dir_lock = Lock()
        self.osd_lock = Lock()

        self.DIR = role.DIR
        self.MRC = role.MRC
        self.OSD = role.OSD
Exemple #20
0
 def __init__(self,
              config_parser, # config file
              **kwargs):     # anything you can't send in config_parser 
                             # (hopefully the new service won't need anything extra)
   BaseAgent.__init__(self, config_parser)
   self.gen_string = config_parser.get('agent', 'STRING_TO_GENERATE')