from onapsdk.aai.business import Customer from onapsdk.configuration import settings from onapsdk.exceptions import APIError from ..base import BaseStep class CustomerCreateStep(BaseStep): """Customer creation step.""" def __init__(self): """Initialize step.""" super().__init__(cleanup=BaseStep.HAS_NO_CLEANUP) @property def description(self) -> str: """Step description.""" return "Create customer." @property def component(self) -> str: """Component name.""" return "AAI" @BaseStep.store_state def execute(self): """Create cutomer. Use settings values: - GLOBAL_CUSTOMER_ID. """ super().execute() try: Customer.create(settings.GLOBAL_CUSTOMER_ID, settings.GLOBAL_CUSTOMER_ID, "INFRA") except APIError: self._logger.warning("Try to update the Customer failed.")