예제 #1
0
    def upsertParameter(self, session: Session, parameter: Parameter) \
            -> None:
        try:
            return ParameterManager().upsertParameter(session, parameter)
        except TortugaException:
            raise
        except Exception as ex:
            self._logger.exception('Error upserting parameter [%s]' %
                                   (parameter.getName()))

            raise TortugaException(exception=ex)
예제 #2
0
    def upsertParameter(self, session: Session, parameter: Parameter) -> None:
        try:
            self._globalParametersDbHandler.upsertParameter(
                session, parameter.getName(), parameter.getValue(),
                description=parameter.getDescription())

            session.commit()
        except TortugaException:
            session.rollback()
            raise
        except Exception:
            session.rollback()
            self._logger.exception('upsertParameter failed')
            raise