Exemplo n.º 1
0
Arquivo: cloud.py Projeto: ema/conpaas
    def __get_config(self, service_id, user_id, app_id, service_type="", vpn=None):
        """Add manager configuration"""
        if not config_parser.has_section("manager"):
            config_parser.add_section("manager")

        config_parser.set("manager", "SERVICE_ID", service_id)
        config_parser.set("manager", "USER_ID", user_id)
        config_parser.set("manager", "APP_ID", app_id)
        config_parser.set("manager", "CREDIT_URL",
                        config_parser.get('director',
                                            'DIRECTOR_URL') + "/credit")
        config_parser.set("manager", "TERMINATE_URL",
                        config_parser.get('director',
                                            'DIRECTOR_URL') + "/terminate")
        config_parser.set("manager", "CA_URL",
                        config_parser.get('director',
                                            'DIRECTOR_URL') + "/ca")
        config_parser.set("manager", "TYPE", service_type)

        if vpn:
            config_parser.set("manager", "IPOP_SUBNET", vpn)

        return config_parser
Exemplo n.º 2
0
    def __get_config(self,
                     service_id,
                     user_id,
                     app_id,
                     service_type="",
                     vpn=None):
        """Add manager configuration"""
        if not config_parser.has_section("manager"):
            config_parser.add_section("manager")

        config_parser.set("manager", "SERVICE_ID", service_id)
        config_parser.set("manager", "USER_ID", user_id)
        config_parser.set("manager", "APP_ID", app_id)
        config_parser.set(
            "manager", "CREDIT_URL",
            config_parser.get('director', 'DIRECTOR_URL') + "/credit")
        config_parser.set(
            "manager", "TERMINATE_URL",
            config_parser.get('director', 'DIRECTOR_URL') + "/terminate")
        config_parser.set(
            "manager", "CA_URL",
            config_parser.get('director', 'DIRECTOR_URL') + "/ca")
        config_parser.set("manager", "TYPE", service_type)

        if vpn:
            config_parser.set("manager", "IPOP_SUBNET", vpn)

        return config_parser
Exemplo n.º 3
0
 def _create_agent_config(self, user_id, app_id, service_id, service_type, manager_ip, vpn=None):
     config_parser = self._create_manager_config(str(user_id), str(app_id))
     config_parser.set('manager', 'SERVICE_ID', service_id)
     config_parser.set('manager', 'TYPE', service_type)
     config_parser.set('manager', 'MANAGER_IP', manager_ip)
     return config_parser