Esempio n. 1
0
 def get_deployment(self):
     """
     Get the exact deployment class based on ENV_DATA
     Example:
     deployment_platform may look like 'aws', 'vmware', 'baremetal'
     deployment_type may be like 'ipi' or 'upi'
     """
     if config.ENV_DATA.get("acm_ocp_deployment"):
         logger.info("Deployment will be done through ACM platform")
         return self.cls_map[constants.ACM_OCP_DEPLOYMENT]()
     deployment_type = config.ENV_DATA["deployment_type"]
     flexy_deployment = config.ENV_DATA["flexy_deployment"]
     deployment_cls_key = (
         f"{self.deployment_platform.lower()}" f"_" f"{deployment_type.lower()}"
     )
     if flexy_deployment:
         deployment_cls_key = f"{deployment_cls_key}_flexy"
     logger.info(f"Deployment key = {deployment_cls_key}")
     logger.info(
         f"Current deployment platform: "
         f"{self.deployment_platform}, "
         f"deployment type: {deployment_type}, "
         f"flexy_deployment: {flexy_deployment}"
     )
     try:
         return self.cls_map[deployment_cls_key]()
     except KeyError:
         raise exceptions.DeploymentPlatformNotSupported(
             "Deployment platform specified is not supported"
         )
Esempio n. 2
0
 def get_deployment(self):
     """
     Get the exact deployment class based on ENV_DATA
     Example:
     deployment_platform may look like 'aws', 'vmware', 'baremetal'
     deployment_type may be like 'ipi' or 'upi'
     """
     deployment_platform = config.ENV_DATA['platform']
     deployment_type = config.ENV_DATA['deployment_type']
     deployment_cls_key = (
         f"{deployment_platform.lower()}"
         f"_"
         f"{deployment_type.lower()}"
     )
     logger.info(f"Deployment key = {deployment_cls_key}")
     logger.info(
         f"Current deployment platform: "
         f"{deployment_platform},"
         f"deployment type: {deployment_type}"
     )
     try:
         return self.cls_map[deployment_cls_key]()
     except KeyError:
         raise exceptions.DeploymentPlatformNotSupported(
             "Deployment platform specified is not supported"
         )