Esempio n. 1
0
    def _read_default_conf(self):
        try:
            self.default_params = conf_util.read_conf(
                constant.Cascading.HWS_CONF_FILE)
            self.default_protocol = self.default_params["project_info"][
                "protocol"]
            self.default_port = self.default_params["project_info"]["port"]
            self.default_host = self.default_params["project_info"]["host"]
            image_info = self.default_params["image"]
            self.default_cascaded_image_name = image_info["cascaded_image"]
            self.default_cascaded_flavor = image_info["cascaded_flavor"]
            self.default_vpn_image_name = image_info["vpn_image"]
            self.default_vpn_flavor = image_info["vpn_flavor"]
            network = self.default_params["network"]
            self.default_vpc_cidr = network["vpc_cidr"]
            self.default_external_api_cidr = network["external_api_cidr"]
            self.default_tunnel_bearing_cidr = network["tunnel_bearing_cidr"]
            self.default_internal_base_cidr = network["internal_base_cidr"]
            self.default_debug_cidr = network["debug_cidr"]

        except IOError as e:
            error = "read file = %s error" % constant.Cascading.HWS_CONF_FILE
            LOG.error(e)
            raise ReadEnvironmentInfoFailure(error=error)
        except KeyError as e:
            error = "read key = %s error in file = %s" % (
                e.message, constant.Cascading.HWS_CONF_FILE)
            LOG.error(error)
            raise ReadEnvironmentInfoFailure(error=error)
Esempio n. 2
0
    def _read_default_conf(self):
        try:
            self.default_params = conf_util.read_conf(constant.Cascading.VCLOUD_CONF_FILE)

            cascaded_info = self.default_params["cascaded"]
            self.cascaded_image = cascaded_info["cascaded_image"]
            self.catalog_name = cascaded_info['catalog_name']

            vpn_info = self.default_params["vpn"]
            self.vpn_image = vpn_info["vpn_image"]

            network = self.default_params["network"]
            self.default_internal_base_cidr = network["internal_base_cidr"]
            self.default_internal_base_name = network["internal_base_name"]
            self.default_external_api_cidr = network["external_api_cidr"]
            self.default_external_api_name = network["external_api_name"]
            self.default_tunnel_bearing_cidr = network["tunnel_bearing_cidr"]
            self.default_tunnel_bearing_name = network["tunnel_bearing_name"]

        except IOError as e:
            error = "read file = %s error" % constant.VcloudConstant.ENV_FILE
            LOG.error(e)
            raise ReadEnvironmentInfoFailure(error = error)
        except KeyError as e:
            error = "read key = %s error in file = %s" % (e.message, _environment_conf)
            LOG.error(error)
            raise ReadEnvironmentInfoFailure(error = error)
Esempio n. 3
0
    def _read_default_conf(self):
        try:
            self.default_params = conf_util.read_conf(constant.Cascading.HWS_CONF_FILE)
            self.default_protocol = self.default_params["project_info"]["protocol"]
            self.default_port = self.default_params["project_info"]["port"]
            self.default_host = self.default_params["project_info"]["host"]
            image_info = self.default_params["image"]
            self.default_cascaded_image_name = image_info["cascaded_image"]
            self.default_cascaded_flavor = image_info["cascaded_flavor"]
            self.default_vpn_image_name = image_info["vpn_image"]
            self.default_vpn_flavor = image_info["vpn_flavor"]
            network = self.default_params["network"]
            self.default_vpc_cidr = network["vpc_cidr"]
            self.default_external_api_cidr = network["external_api_cidr"]
            self.default_tunnel_bearing_cidr = network["tunnel_bearing_cidr"]
            self.default_internal_base_cidr = network["internal_base_cidr"]
            self.default_debug_cidr = network["debug_cidr"]

        except IOError as e:
            error = "read file = %s error" % constant.Cascading.HWS_CONF_FILE
            LOG.error(e)
            raise ReadEnvironmentInfoFailure(error = error)
        except KeyError as e:
            error = "read key = %s error in file = %s" % (e.message, constant.Cascading.HWS_CONF_FILE)
            LOG.error(error)
            raise ReadEnvironmentInfoFailure(error = error)
Esempio n. 4
0
    def _read_default_conf(self):
        try:
            self.default_params = conf_util.read_conf(
                constant.Cascading.VCLOUD_CONF_FILE)

            cascaded_info = self.default_params["cascaded"]
            self.cascaded_image = cascaded_info["cascaded_image"]
            self.catalog_name = cascaded_info['catalog_name']

            vpn_info = self.default_params["vpn"]
            self.vpn_image = vpn_info["vpn_image"]

            network = self.default_params["network"]
            self.default_internal_base_cidr = network["internal_base_cidr"]
            self.default_internal_base_name = network["internal_base_name"]
            self.default_external_api_cidr = network["external_api_cidr"]
            self.default_external_api_name = network["external_api_name"]
            self.default_tunnel_bearing_cidr = network["tunnel_bearing_cidr"]
            self.default_tunnel_bearing_name = network["tunnel_bearing_name"]

        except IOError as e:
            error = "read file = %s error" % constant.VcloudConstant.ENV_FILE
            LOG.error(e)
            raise ReadEnvironmentInfoFailure(error=error)
        except KeyError as e:
            error = "read key = %s error in file = %s" % (e.message,
                                                          _environment_conf)
            LOG.error(error)
            raise ReadEnvironmentInfoFailure(error=error)
Esempio n. 5
0
    def initialize(self, cloud_params, install_info):
        self.cloud_params = cloud_params

        default_params = conf_util.read_conf(constant.Cascading.HWS_CONF_FILE)
        self.cloud_params["project_info"]["host"] = default_params[
            "project_info"]["host"]

        self.install_info = install_info
        self.proxy_info = self.install_info["proxy_info"]
        cloud_id = self.install_info["cloud_id"]
        self.cloud_info_handler = \
            HwsCloudInfoPersist(constant.HwsConstant.CLOUD_INFO_FILE, cloud_id)
        self._modify_cascaded_external_api()
Esempio n. 6
0
 def _read_env(self):
     try:
         env_info = conf_util.read_conf(constant.VcloudConstant.ENV_FILE)
         self.env = env_info["env"]
         self.cascading_api_ip = env_info["cascading_api_ip"]
         self.cascading_domain = env_info["cascading_domain"]
         self.cascading_vpn_ip = env_info["local_vpn_ip"]
         self.cascading_vpn_public_gw = env_info["local_vpn_public_gw"]
         self.cascading_eip = env_info["cascading_eip"]
         self.cascading_api_subnet = env_info["local_api_subnet"]
         self.cascading_vpn_api_ip = env_info["local_vpn_api_ip"]
         self.cascading_tunnel_subnet = env_info["local_tunnel_subnet"]
         self.cascading_vpn_tunnel_ip = env_info["local_vpn_tunnel_ip"]
         self.existed_cascaded = env_info["existed_cascaded"]
     except ReadEnvironmentInfoFailure as e:
         LOG.error(
             "read environment info error. check the config file: %s"
             % e.message)
         raise ReadEnvironmentInfoFailure(error=e.message)
Esempio n. 7
0
 def _read_env(self):
     try:
         env_info = conf_util.read_conf(constant.VcloudConstant.ENV_FILE)
         self.env = env_info["env"]
         self.cascading_api_ip = env_info["cascading_api_ip"]
         self.cascading_domain = env_info["cascading_domain"]
         self.cascading_vpn_ip = env_info["local_vpn_ip"]
         self.cascading_vpn_public_gw = env_info["local_vpn_public_gw"]
         self.cascading_eip = env_info["cascading_eip"]
         self.cascading_api_subnet = env_info["local_api_subnet"]
         self.cascading_vpn_api_ip = env_info["local_vpn_api_ip"]
         self.cascading_tunnel_subnet = env_info["local_tunnel_subnet"]
         self.cascading_vpn_tunnel_ip = env_info["local_vpn_tunnel_ip"]
         self.existed_cascaded = env_info["existed_cascaded"]
     except ReadEnvironmentInfoFailure as e:
         LOG.error(
             "read environment info error. check the config file: %s" %
             e.message)
         raise ReadEnvironmentInfoFailure(error=e.message)
Esempio n. 8
0
 def _read_env(self):
     try:
         env_info = conf_util.read_conf(constant.Cascading.ENV_FILE)
         self.env = env_info["env"]
         self.cascading_api_ip = env_info["cascading_api_ip"]
         self.cascading_domain = env_info["cascading_domain"]
         self.cascading_vpn_ip = env_info["local_vpn_ip"]
         self.cascading_vpn_public_gw = env_info["local_vpn_public_gw"]
         self.cascading_eip = env_info["cascading_eip"]
         self.cascading_api_subnet = env_info["local_api_subnet"]
         self.cascading_vpn_api_ip = env_info["local_vpn_api_ip"]
         self.cascading_tunnel_subnet = env_info["local_tunnel_subnet"]
         self.cascading_vpn_tunnel_ip = env_info["local_vpn_tunnel_ip"]
         self.existed_cascaded = env_info["existed_cascaded"]
     except IOError as e:
         error = "read file = %s error" % constant.Cascading.ENV_FILE
         LOG.error(e)
         raise ReadEnvironmentInfoFailure(error = error)
     except KeyError as e:
         error = "read key = %s error in file = %s" % (e.message, constant.Cascading.ENV_FILE    )
         LOG.error(error)
         raise ReadEnvironmentInfoFailure(error = error)
Esempio n. 9
0
 def _read_env(self):
     try:
         env_info = conf_util.read_conf(constant.Cascading.ENV_FILE)
         self.env = env_info["env"]
         self.cascading_api_ip = env_info["cascading_api_ip"]
         self.cascading_domain = env_info["cascading_domain"]
         self.cascading_vpn_ip = env_info["local_vpn_ip"]
         self.cascading_vpn_public_gw = env_info["local_vpn_public_gw"]
         self.cascading_eip = env_info["cascading_eip"]
         self.cascading_api_subnet = env_info["local_api_subnet"]
         self.cascading_vpn_api_ip = env_info["local_vpn_api_ip"]
         self.cascading_tunnel_subnet = env_info["local_tunnel_subnet"]
         self.cascading_vpn_tunnel_ip = env_info["local_vpn_tunnel_ip"]
         self.existed_cascaded = env_info["existed_cascaded"]
     except IOError as e:
         error = "read file = %s error" % constant.Cascading.ENV_FILE
         LOG.error(e)
         raise ReadEnvironmentInfoFailure(error=error)
     except KeyError as e:
         error = "read key = %s error in file = %s" % (
             e.message, constant.Cascading.ENV_FILE)
         LOG.error(error)
         raise ReadEnvironmentInfoFailure(error=error)