From 4dc37abcd530b27ea79fe5e440b4370aa7bc9edd Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Tue, 1 Jul 2014 11:34:08 +0200 Subject: [PATCH] Change logging level AUDIT to INFO According to the latest revision of the logging guidelines message of type AUDIT should be moved to INFO. The latest revision is available at https://review.openstack.org/#/c/91446/ at the moment. Change-Id: I2d86fa634f6424b0bb862319b9ae40d3f3b1ec7a --- cinder/api/contrib/backups.py | 16 ++++++++-------- cinder/api/contrib/hosts.py | 4 ++-- cinder/api/contrib/volume_transfer.py | 12 ++++++------ cinder/api/contrib/volume_unmanage.py | 2 +- cinder/api/extensions.py | 4 ++-- cinder/api/v1/snapshots.py | 4 ++-- cinder/api/v1/volumes.py | 6 +++--- cinder/api/v2/snapshots.py | 4 ++-- cinder/api/v2/volumes.py | 4 ++-- cinder/backup/api.py | 16 ++++++++-------- cinder/service.py | 4 ++-- 11 files changed, 38 insertions(+), 38 deletions(-) diff --git a/cinder/api/contrib/backups.py b/cinder/api/contrib/backups.py index d04c94fd1..7547dc2c5 100644 --- a/cinder/api/contrib/backups.py +++ b/cinder/api/contrib/backups.py @@ -174,7 +174,7 @@ class BackupsController(wsgi.Controller): LOG.debug('delete called for member %s', id) context = req.environ['cinder.context'] - LOG.audit(_('Delete backup with id: %s'), id, context=context) + LOG.info(_('Delete backup with id: %s'), id, context=context) try: self.backup_api.delete(context, id) @@ -247,10 +247,10 @@ class BackupsController(wsgi.Controller): name = backup.get('name', None) description = backup.get('description', None) - LOG.audit(_("Creating backup of volume %(volume_id)s in container" - " %(container)s"), - {'volume_id': volume_id, 'container': container}, - context=context) + LOG.info(_("Creating backup of volume %(volume_id)s in container" + " %(container)s"), + {'volume_id': volume_id, 'container': container}, + context=context) try: new_backup = self.backup_api.create(context, name, description, @@ -280,9 +280,9 @@ class BackupsController(wsgi.Controller): restore = body['restore'] volume_id = restore.get('volume_id', None) - LOG.audit(_("Restoring backup %(backup_id)s to volume %(volume_id)s"), - {'backup_id': id, 'volume_id': volume_id}, - context=context) + LOG.info(_("Restoring backup %(backup_id)s to volume %(volume_id)s"), + {'backup_id': id, 'volume_id': volume_id}, + context=context) try: new_restore = self.backup_api.restore(context, diff --git a/cinder/api/contrib/hosts.py b/cinder/api/contrib/hosts.py index e5c76c859..824106f25 100644 --- a/cinder/api/contrib/hosts.py +++ b/cinder/api/contrib/hosts.py @@ -178,8 +178,8 @@ class HostController(wsgi.Controller): """Sets the specified host's ability to accept new volumes.""" context = req.environ['cinder.context'] state = "enabled" if enabled else "disabled" - LOG.audit(_("Setting host %(host)s to %(state)s."), - {'host': host, 'state': state}) + LOG.info(_("Setting host %(host)s to %(state)s."), + {'host': host, 'state': state}) result = self.api.set_host_enabled(context, host=host, enabled=enabled) diff --git a/cinder/api/contrib/volume_transfer.py b/cinder/api/contrib/volume_transfer.py index c2aab33da..a3e7deb8e 100644 --- a/cinder/api/contrib/volume_transfer.py +++ b/cinder/api/contrib/volume_transfer.py @@ -160,9 +160,9 @@ class VolumeTransferController(wsgi.Controller): name = transfer.get('name', None) - LOG.audit(_("Creating transfer of volume %s"), - volume_id, - context=context) + LOG.info(_("Creating transfer of volume %s"), + volume_id, + context=context) try: new_transfer = self.transfer_api.create(context, volume_id, name) @@ -194,8 +194,8 @@ class VolumeTransferController(wsgi.Controller): msg = _("Incorrect request body format") raise exc.HTTPBadRequest(explanation=msg) - LOG.audit(_("Accepting transfer %s"), transfer_id, - context=context) + LOG.info(_("Accepting transfer %s"), transfer_id, + context=context) try: accepted_transfer = self.transfer_api.accept(context, transfer_id, @@ -215,7 +215,7 @@ class VolumeTransferController(wsgi.Controller): """Delete a transfer.""" context = req.environ['cinder.context'] - LOG.audit(_("Delete transfer with id: %s"), id, context=context) + LOG.info(_("Delete transfer with id: %s"), id, context=context) try: self.transfer_api.delete(context, transfer_id=id) diff --git a/cinder/api/contrib/volume_unmanage.py b/cinder/api/contrib/volume_unmanage.py index 3b30e85bc..6486ffa16 100755 --- a/cinder/api/contrib/volume_unmanage.py +++ b/cinder/api/contrib/volume_unmanage.py @@ -51,7 +51,7 @@ class VolumeUnmanageController(wsgi.Controller): context = req.environ['cinder.context'] authorize(context) - LOG.audit(_("Unmanage volume with id: %s"), id, context=context) + LOG.info(_("Unmanage volume with id: %s"), id, context=context) try: vol = self.volume_api.get(context, id) diff --git a/cinder/api/extensions.py b/cinder/api/extensions.py index 899fe4401..6209433e5 100644 --- a/cinder/api/extensions.py +++ b/cinder/api/extensions.py @@ -181,7 +181,7 @@ class ExtensionManager(object): """ def __init__(self): - LOG.audit(_('Initializing extension manager.')) + LOG.info(_('Initializing extension manager.')) self.cls_list = CONF.osapi_volume_extension self.extensions = {} @@ -196,7 +196,7 @@ class ExtensionManager(object): return alias = ext.alias - LOG.audit(_('Loaded extension: %s'), alias) + LOG.info(_('Loaded extension: %s'), alias) if alias in self.extensions: raise exception.Error("Found duplicate extension: %s" % alias) diff --git a/cinder/api/v1/snapshots.py b/cinder/api/v1/snapshots.py index 4ab3c946f..8ec4954fc 100644 --- a/cinder/api/v1/snapshots.py +++ b/cinder/api/v1/snapshots.py @@ -116,7 +116,7 @@ class SnapshotsController(wsgi.Controller): """Delete a snapshot.""" context = req.environ['cinder.context'] - LOG.audit(_("Delete snapshot with id: %s"), id, context=context) + LOG.info(_("Delete snapshot with id: %s"), id, context=context) try: snapshot = self.volume_api.get_snapshot(context, id) @@ -180,7 +180,7 @@ class SnapshotsController(wsgi.Controller): force = snapshot.get('force', False) msg = _("Create snapshot from volume %s") - LOG.audit(msg, volume_id, context=context) + LOG.info(msg, volume_id, context=context) if not utils.is_valid_boolstr(force): msg = _("Invalid value '%s' for force. ") % force diff --git a/cinder/api/v1/volumes.py b/cinder/api/v1/volumes.py index 9a07a7891..c262b5ca0 100644 --- a/cinder/api/v1/volumes.py +++ b/cinder/api/v1/volumes.py @@ -112,7 +112,7 @@ def _translate_volume_summary_view(context, vol, image_id=None): if image_id: d['image_id'] = image_id - LOG.audit(_("vol=%s"), vol, context=context) + LOG.info(_("vol=%s"), vol, context=context) if vol.get('volume_metadata'): metadata = vol.get('volume_metadata') @@ -243,7 +243,7 @@ class VolumeController(wsgi.Controller): """Delete a volume.""" context = req.environ['cinder.context'] - LOG.audit(_("Delete volume with id: %s"), id, context=context) + LOG.info(_("Delete volume with id: %s"), id, context=context) try: volume = self.volume_api.get(context, id) @@ -367,7 +367,7 @@ class VolumeController(wsgi.Controller): elif size is None and kwargs['source_volume'] is not None: size = kwargs['source_volume']['size'] - LOG.audit(_("Create volume of %s GB"), size, context=context) + LOG.info(_("Create volume of %s GB"), size, context=context) image_href = None image_uuid = None diff --git a/cinder/api/v2/snapshots.py b/cinder/api/v2/snapshots.py index 01522de2a..2af416303 100644 --- a/cinder/api/v2/snapshots.py +++ b/cinder/api/v2/snapshots.py @@ -117,7 +117,7 @@ class SnapshotsController(wsgi.Controller): """Delete a snapshot.""" context = req.environ['cinder.context'] - LOG.audit(_("Delete snapshot with id: %s"), id, context=context) + LOG.info(_("Delete snapshot with id: %s"), id, context=context) try: snapshot = self.volume_api.get_snapshot(context, id) @@ -191,7 +191,7 @@ class SnapshotsController(wsgi.Controller): raise exc.HTTPNotFound(explanation=msg) force = snapshot.get('force', False) msg = _("Create snapshot from volume %s") - LOG.audit(msg, volume_id, context=context) + LOG.info(msg, volume_id, context=context) # NOTE(thingee): v2 API allows name instead of display_name if 'name' in snapshot: diff --git a/cinder/api/v2/volumes.py b/cinder/api/v2/volumes.py index dbe531dcf..9945f1207 100644 --- a/cinder/api/v2/volumes.py +++ b/cinder/api/v2/volumes.py @@ -179,7 +179,7 @@ class VolumeController(wsgi.Controller): """Delete a volume.""" context = req.environ['cinder.context'] - LOG.audit(_("Delete volume with id: %s"), id, context=context) + LOG.info(_("Delete volume with id: %s"), id, context=context) try: volume = self.volume_api.get(context, id) @@ -331,7 +331,7 @@ class VolumeController(wsgi.Controller): elif size is None and kwargs['source_volume'] is not None: size = kwargs['source_volume']['size'] - LOG.audit(_("Create volume of %s GB"), size, context=context) + LOG.info(_("Create volume of %s GB"), size, context=context) if self.ext_mgr.is_loaded('os-image-create'): image_href = volume.get('imageRef') diff --git a/cinder/backup/api.py b/cinder/backup/api.py index d84080fe1..ae943e44e 100644 --- a/cinder/backup/api.py +++ b/cinder/backup/api.py @@ -164,10 +164,10 @@ class API(base.Base): name = 'restore_backup_%s' % backup_id description = 'auto-created_from_restore_from_backup' - LOG.audit(_("Creating volume of %(size)s GB for restore of " - "backup %(backup_id)s"), - {'size': size, 'backup_id': backup_id}, - context=context) + LOG.info(_("Creating volume of %(size)s GB for restore of " + "backup %(backup_id)s"), + {'size': size, 'backup_id': backup_id}, + context=context) volume = self.volume_api.create(context, size, name, description) volume_id = volume['id'] @@ -191,10 +191,10 @@ class API(base.Base): {'volume_size': volume['size'], 'size': size}) raise exception.InvalidVolume(reason=msg) - LOG.audit(_("Overwriting volume %(volume_id)s with restore of " - "backup %(backup_id)s"), - {'volume_id': volume_id, 'backup_id': backup_id}, - context=context) + LOG.info(_("Overwriting volume %(volume_id)s with restore of " + "backup %(backup_id)s"), + {'volume_id': volume_id, 'backup_id': backup_id}, + context=context) # Setting the status here rather than setting at start and unrolling # for each error condition, it should be a very small window diff --git a/cinder/service.py b/cinder/service.py index 0dedc274e..3554f67c2 100755 --- a/cinder/service.py +++ b/cinder/service.py @@ -101,8 +101,8 @@ class Service(service.Service): def start(self): version_string = version.version_string() - LOG.audit(_('Starting %(topic)s node (version %(version_string)s)'), - {'topic': self.topic, 'version_string': version_string}) + LOG.info(_('Starting %(topic)s node (version %(version_string)s)'), + {'topic': self.topic, 'version_string': version_string}) self.model_disconnected = False self.manager.init_host() ctxt = context.get_admin_context() -- 2.45.2