Ejemplo n.º 1
0
 def _get_strategy(self, context, fieldname, value):
     try:
         return self._get(context,
                          model=models.Strategy,
                          fieldname=fieldname,
                          value=value)
     except exception.ResourceNotFound:
         raise exception.StrategyNotFound(strategy=value)
Ejemplo n.º 2
0
    def update_strategy(self, strategy_id, values):
        if 'uuid' in values:
            raise exception.Invalid(
                message=_("Cannot overwrite UUID for an existing Strategy."))

        try:
            return self._update(models.Strategy, strategy_id, values)
        except exception.ResourceNotFound:
            raise exception.StrategyNotFound(strategy=strategy_id)
Ejemplo n.º 3
0
 def soft_delete_strategy(self, strategy_id):
     try:
         return self._soft_delete(models.Strategy, strategy_id)
     except exception.ResourceNotFound:
         raise exception.StrategyNotFound(strategy=strategy_id)
Ejemplo n.º 4
0
 def destroy_strategy(self, strategy_id):
     try:
         return self._destroy(models.Strategy, strategy_id)
     except exception.ResourceNotFound:
         raise exception.StrategyNotFound(strategy=strategy_id)