Fix Trigger Creation Failed

When we create a trigger, it throws a exception like
"Unable to create trigger". The reason is that python-smaugclient
has changed the return value of trigger creation.
So it needs to update dashboard as well.

Change-Id: I683cc699adc89a5cee7da21d081d6d761b22370f
Closes-Bug: #1613587
This commit is contained in:
xiangxinyong
2016-08-16 15:56:41 +08:00
parent 7b8ca5539b
commit 0c18dfc9e5

View File

@@ -21,7 +21,6 @@ from horizon import messages
from smaug_dashboard.api import smaug as smaugclient
from smaug_dashboard.triggers import utils
from smaugclient.v1 import triggers
class CreateTriggerForm(horizon_forms.SelfHandlingForm):
@@ -73,7 +72,7 @@ class CreateTriggerForm(horizon_forms.SelfHandlingForm):
data_properties)
messages.success(request, _("Trigger created successfully."))
return triggers.Trigger(self, new_trigger)
return new_trigger
except Exception:
exceptions.handle(request, _('Unable to create trigger.'))
return False