def create_deployment_update_step(self, deployment_update, action, entity_type, entity_id): step = models.DeploymentUpdateStep(id=str(uuid.uuid4()), action=action, entity_type=entity_type, entity_id=entity_id) step.set_deployment_update(deployment_update) return self.sm.put(step)
def create_deployment_update_step(self, deployment_update_id, action, entity_type, entity_id): """Create deployment update step :param deployment_update_id: :param action: add/remove/modify :param entity_type: add/relationship :param entity_id: :return: """ step = models.DeploymentUpdateStep( action=action, entity_type=entity_type, entity_id=entity_id, deployment_update_id=deployment_update_id) return self.sm.put_deployment_update_step(step)
def create_deployment_update_step(self, deployment_update_id, action, entity_type, entity_id): """Create deployment update step :param deployment_update_id: :param action: add/remove/modify :param entity_type: add/relationship :param entity_id: :return: """ step = models.DeploymentUpdateStep(action, entity_type, entity_id) dep_update = self.get_deployment_update(deployment_update_id) self._step_validator.validate(dep_update, step) self.sm.put_deployment_update_step(deployment_update_id, step) return step
def _restore_deployment_updates_and_modifications(self): for line in open(self._deployments_ex_path, 'r'): elem = json.loads(line) node_data = elem['_source'] node_type = elem['_type'] self._update_deployment(node_data) if node_type == 'deployment_updates': dep_update = models.DeploymentUpdate(**node_data) self._storage_manager.put(dep_update) if 'steps' in node_data: steps = node_data['steps'] for step in steps: dep_step = models.DeploymentUpdateStep(**step) self._storage_manager.put(dep_step) elif node_type == 'deployment_modifications': dep_modification = models.DeploymentModification(**node_data) self._storage_manager.put(dep_modification) else: logger.warning('Unknown node type: {0}'.format(node_type))
def create_deployment_update_step(self, deployment_update_id, action, entity_type, entity_id): """Create deployment update step :param deployment_update_id: :param action: add/remove/modify :param entity_type: add/relationship :param entity_id: :return: """ step = models.DeploymentUpdateStep( id=str(uuid.uuid4()), action=action, entity_type=entity_type, entity_id=entity_id, ) deployment_update = self.get_deployment_update(deployment_update_id) step.set_deployment_update(deployment_update) return self.sm.put(step)
def convert_step_to_model_step(step): return models.DeploymentUpdateStep(action=step.action, entity_type=step.entity_type, entity_id=step.entity_id)