Merge "Make no response notification(msg) level to INFO"

This commit is contained in:
Jenkins 2016-03-31 12:25:11 +00:00 committed by Gerrit Code Review
commit e1f07e2794
9 changed files with 19 additions and 16 deletions

View File

@ -69,7 +69,7 @@ class LiveMigrateForm(forms.SelfHandlingForm):
disk_over_commit=disk_over_commit) disk_over_commit=disk_over_commit)
msg = _('The instance is preparing the live migration ' msg = _('The instance is preparing the live migration '
'to host "%s".') % data['host'] 'to host "%s".') % data['host']
messages.success(request, msg) messages.info(request, msg)
return True return True
except Exception: except Exception:
msg = _('Failed to live migrate instance to ' msg = _('Failed to live migrate instance to '

View File

@ -265,9 +265,9 @@ class CreateImageForm(forms.SelfHandlingForm):
try: try:
image = api.glance.image_create(request, **meta) image = api.glance.image_create(request, **meta)
messages.success(request, messages.info(request,
_('Your image %s has been queued for creation.') % _('Your image %s has been queued for creation.') %
meta['name']) meta['name'])
return image return image
except Exception as e: except Exception as e:
msg = _('Unable to create new image') msg = _('Unable to create new image')

View File

@ -107,7 +107,7 @@ class RebuildInstanceForm(forms.SelfHandlingForm):
try: try:
api.nova.server_rebuild(request, instance, image, password, api.nova.server_rebuild(request, instance, image, password,
disk_config) disk_config)
messages.success(request, _('Rebuilding instance %s.') % instance) messages.info(request, _('Rebuilding instance %s.') % instance)
except Exception: except Exception:
redirect = reverse('horizon:project:instances:index') redirect = reverse('horizon:project:instances:index')
exceptions.handle(request, _("Unable to rebuild instance."), exceptions.handle(request, _("Unable to rebuild instance."),

View File

@ -869,7 +869,8 @@ class LaunchInstance(workflows.Workflow):
slug = "launch_instance" slug = "launch_instance"
name = _("Launch Instance") name = _("Launch Instance")
finalize_button_name = _("Launch") finalize_button_name = _("Launch")
success_message = _('Launched %(count)s named "%(name)s".') success_message = _('Request for launching %(count)s named "%(name)s" '
'has been submitted.')
failure_message = _('Unable to launch %(count)s named "%(name)s".') failure_message = _('Unable to launch %(count)s named "%(name)s".')
success_url = "horizon:project:instances:index" success_url = "horizon:project:instances:index"
multipart = True multipart = True

View File

@ -83,7 +83,8 @@ class ResizeInstance(workflows.Workflow):
slug = "resize_instance" slug = "resize_instance"
name = _("Resize Instance") name = _("Resize Instance")
finalize_button_name = _("Resize") finalize_button_name = _("Resize")
success_message = _('Scheduled resize of instance "%s".') success_message = _('Request for resizing of instance "%s" '
'has been submitted.')
failure_message = _('Unable to resize instance "%s".') failure_message = _('Unable to resize instance "%s".')
success_url = "horizon:project:instances:index" success_url = "horizon:project:instances:index"
default_steps = (SetFlavorChoice, create_instance.SetAdvanced) default_steps = (SetFlavorChoice, create_instance.SetAdvanced)

View File

@ -381,7 +381,7 @@ class CreateStackForm(forms.SelfHandlingForm):
try: try:
api.heat.stack_create(self.request, **fields) api.heat.stack_create(self.request, **fields)
messages.success(request, _("Stack creation started.")) messages.info(request, _("Stack creation started."))
return True return True
except Exception: except Exception:
exceptions.handle(request) exceptions.handle(request)
@ -430,7 +430,7 @@ class EditStackForm(CreateStackForm):
try: try:
api.heat.stack_update(self.request, stack_id=stack_id, **fields) api.heat.stack_update(self.request, stack_id=stack_id, **fields)
messages.success(request, _("Stack update started.")) messages.info(request, _("Stack update started."))
return True return True
except Exception: except Exception:
exceptions.handle(request) exceptions.handle(request)

View File

@ -54,7 +54,7 @@ class CreateBackupForm(forms.SelfHandlingForm):
data['description']) data['description'])
message = _('Creating volume backup "%s"') % data['name'] message = _('Creating volume backup "%s"') % data['name']
messages.success(request, message) messages.info(request, message)
return backup return backup
except Exception: except Exception:
@ -98,10 +98,11 @@ class RestoreBackupForm(forms.SelfHandlingForm):
# Needed for cases when a new volume is created. # Needed for cases when a new volume is created.
volume_id = restore.volume_id volume_id = restore.volume_id
message = _('Successfully restored backup %(backup_name)s ' message = _('Request for restoring backup %(backup_name)s '
'to volume with id: %(volume_id)s') 'to volume with id: %(volume_id)s '
messages.success(request, message % {'backup_name': backup_name, 'has been submitted.')
'volume_id': volume_id}) messages.info(request, message % {'backup_name': backup_name,
'volume_id': volume_id})
return restore return restore
except Exception: except Exception:
msg = _('Unable to restore backup.') msg = _('Unable to restore backup.')

View File

@ -164,5 +164,5 @@ class VolumeBackupsViewTests(test.TestCase):
res = self.client.post(url, formData) res = self.client.post(url, formData)
self.assertNoFormErrors(res) self.assertNoFormErrors(res)
self.assertMessageCount(success=1) self.assertMessageCount(info=1)
self.assertRedirectsNoFollow(res, INDEX_URL) self.assertRedirectsNoFollow(res, INDEX_URL)

View File

@ -30,7 +30,7 @@ class TestImagesBasic(helpers.TestCase):
image_file=local_file) image_file=local_file)
else: else:
images_page.create_image(IMAGE_NAME) images_page.create_image(IMAGE_NAME)
self.assertTrue(images_page.find_message_and_dismiss(messages.SUCCESS)) self.assertTrue(images_page.find_message_and_dismiss(messages.INFO))
self.assertFalse(images_page.find_message_and_dismiss(messages.ERROR)) self.assertFalse(images_page.find_message_and_dismiss(messages.ERROR))
self.assertTrue(images_page.is_image_present(IMAGE_NAME)) self.assertTrue(images_page.is_image_present(IMAGE_NAME))
self.assertTrue(images_page.is_image_active(IMAGE_NAME)) self.assertTrue(images_page.is_image_active(IMAGE_NAME))