Merge branch 'master' of github.com:Mirantis/product

This commit is contained in:
Nikolay Markov 2012-07-26 14:12:15 +04:00
commit 7c3614feb2
3 changed files with 14 additions and 20 deletions

View File

@ -74,11 +74,9 @@ $/isoroot-pool.done: $(ubuntu.packages)/cache.done
$(ACTION.TOUCH)
$/isoroot-centos.done: $(centos.packages)/cache.done
mkdir -p $(ISOROOT)/centos/$(CENTOSRELEASE)
find $(centos.packages)/Packages -name '*.rpm' | while read rpmfile; do \
cp -n $${rpmfile} $(ISOROOT)/centos/$(CENTOSRELEASE)/ ; \
done
createrepo -g `readlink -f "$(centos.packages)/comps.xml"` -o $(ISOROOT)/centos/$(CENTOSRELEASE) $(ISOROOT)/centos/$(CENTOSRELEASE)
mkdir -p $(ISOROOT)/centos/$(CENTOS_62_RELEASE)
find $(centos.packages)/Packages -name '*.rpm' -exec cp -n {} $(ISOROOT)/centos/$(CENTOS_62_RELEASE) \;
createrepo -g `readlink -f "$(centos.packages)/comps.xml"` -o $(ISOROOT)/centos/$(CENTOS_62_RELEASE) $(ISOROOT)/centos/$(CENTOS_62_RELEASE)
$(ACTION.TOUCH)
$/isoroot-keyring.done: $/isoroot-pool.done $/debian/ubuntu-keyring/.done

View File

@ -48,7 +48,7 @@ class TaskHandler(BaseHandler):
task_tree = {
"task_id": task.task_id,
"status": task.state,
#"ready": task.ready(),
"ready": task.ready(),
#"name": getattr(task, 'task_name', None),
"subtasks": None,
"error": None,
@ -71,9 +71,12 @@ class TaskHandler(BaseHandler):
def render(cls, task):
task_tree = TaskHandler.render_task_tree(task)
statuses = []
errors = []
def check_status(_task):
statuses.append(_task['status'])
if _task['error']:
errors.append(_task['error'])
if _task['subtasks']:
for t in _task['subtasks']:
check_status(t)
@ -82,20 +85,12 @@ class TaskHandler(BaseHandler):
task_result = {
"task_id": task.task_id,
# TODO(mihgen): Put error and traceback for failing task here
"error": None,
"traceback": None,
"ready": False,
"error": '\n'.join(errors)
}
if "FAILURE" in statuses:
task_result['status'] = 'FAILURE'
elif "PENDING" in statuses:
task_result['status'] = 'PENDING'
elif "REVOKED" in statuses:
task_result['status'] = 'REVOKED'
elif "SUCCESS" in statuses and len(set(statuses)) == 1:
task_result['status'] = 'SUCCESS'
else:
task_result['status'] = 'UNKNOWN'
if "SUCCESS" in statuses and len(set(statuses)) == 1:
task_result['ready'] = True
return task_result
def read(self, request, task_id):

View File

@ -459,7 +459,8 @@ class TestHandlers(TestCase):
resp_json = json.loads(resp.content)
self.assertEquals(len(resp_json['task_id']), 36)
self.assertEquals(resp_json['status'], "SUCCESS")
self.assertEquals(resp_json['ready'], True)
self.assertEquals(resp_json['error'], "")
def test_release_create(self):
release_name = "OpenStack"