Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fabrics should be sorted in the fabric select screen in glu #309

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import time
import urllib
import urlparse
from xml.dom.minidom import parseString


try:
Expand Down Expand Up @@ -222,8 +223,25 @@ def _execute_plan(self, created_plan, dryrun):
time.sleep(2)

self._action_successful = complete_status.startswith('100:COMPLETED')
if complete_status.endswith('FAILED'):
self.print_failed_jobs(status_url)
return complete_status

def print_failed_jobs(self, status_url):
"""
Prints failed jobs in current deployment, If exists.
:param status_url: current deployment job status url
"""
status = self._do_request(status_url, 'GET')
soup = parseString(status.body)
errors = soup.getElementsByTagName('exception')
message_re = re.compile(r'\[(.*)\].*action=(.*)')
for err in errors:
msg = err.attributes.get('message')
result = message_re.findall(msg.value)
if result:
logger.info('Failed "%s" app to %s' % result[0])

def executePlan(self, action, systemFilter, # pylint: disable=C0103
parallel=False, dryrun=False): # pylint: disable=C0103
"""Deprecated version of execute_plan()"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class FabricController extends ControllerBase
def index = { redirect(action:select, params:params) }

def select = {
def fabrics = fabricService.fabrics
//Fabrics should be sorted in the fabric select screen in glu
def fabrics = fabricService.fabrics.sort { it.name }

if(!fabrics)
{
Expand Down