From 049ca9b739ee81f6a63c39795853b9a6dc628c23 Mon Sep 17 00:00:00 2001 From: Tzu-Mainn Chen Date: Tue, 24 Sep 2013 14:15:39 -0400 Subject: [PATCH] rack creation error fix Change-Id: I9a7afad61a8432ff29f300bf6a1f2a9bbeed46f2 Fixes: bug #1211781 --- .../resource_management/racks/workflows.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tuskar_ui/infrastructure/resource_management/racks/workflows.py b/tuskar_ui/infrastructure/resource_management/racks/workflows.py index b401fbeba..a13ee8aca 100644 --- a/tuskar_ui/infrastructure/resource_management/racks/workflows.py +++ b/tuskar_ui/infrastructure/resource_management/racks/workflows.py @@ -17,8 +17,11 @@ from django.utils.translation import ugettext_lazy as _ # noqa from horizon import exceptions from horizon import forms +from horizon import messages from horizon import workflows +import requests + from tuskar_ui import api as tuskar @@ -186,8 +189,14 @@ class CreateRack(workflows.Workflow): nodes=[{'id': node_id}]) return True + except requests.ConnectionError: + messages.error(request, + _("Unable to connect to Nova Baremetal. Please " + "check your configuration.")) + return False except Exception: exceptions.handle(request, _("Unable to create rack.")) + return False class EditRack(CreateRack):