Merge "Replace deprecated [logger/LOG].warn with warning"

This commit is contained in:
Jenkins 2016-01-09 05:32:59 +00:00 committed by Gerrit Code Review
commit 5a4a029e44
28 changed files with 186 additions and 173 deletions

View File

@ -24,14 +24,15 @@ LOG = log.getLogger(__name__)
class ManilaKeystoneContext(auth.ManilaKeystoneContext):
def __init__(self, application):
LOG.warn(_LW('manila.api.auth:ManilaKeystoneContext is deprecated. '
'Please use '
'manila.api.middleware.auth:ManilaKeystoneContext '
'instead.'))
LOG.warning(_LW('manila.api.auth:ManilaKeystoneContext is deprecated. '
'Please use '
'manila.api.middleware.auth:ManilaKeystoneContext '
'instead.'))
super(ManilaKeystoneContext, self).__init__(application)
def pipeline_factory(loader, global_conf, **local_conf):
LOG.warn(_LW('manila.api.auth:pipeline_factory is deprecated. Please use '
'manila.api.middleware.auth:pipeline_factory instead.'))
LOG.warning(_LW('manila.api.auth:pipeline_factory is deprecated. '
'Please use manila.api.middleware.auth:pipeline_factory '
'instead.'))
auth.pipeline_factory(loader, global_conf, **local_conf)

View File

@ -220,11 +220,11 @@ class ExtensionManager(object):
'standard_extensions')
new_contrib_path = 'manila.api.contrib.standard_extensions'
if old_contrib_path in extensions:
LOG.warn(_LW('osapi_share_extension is set to deprecated path: '
'%s'),
old_contrib_path)
LOG.warn(_LW('Please set your flag or manila.conf settings for '
'osapi_share_extension to: %s'), new_contrib_path)
LOG.warning(_LW('osapi_share_extension is set to deprecated path: '
'%s.'),
old_contrib_path)
LOG.warning(_LW('Please set your flag or manila.conf settings for '
'osapi_share_extension to: %s.'), new_contrib_path)
extensions = [e.replace(old_contrib_path, new_contrib_path)
for e in extensions]
@ -232,9 +232,9 @@ class ExtensionManager(object):
try:
self.load_extension(ext_factory)
except Exception as exc:
LOG.warn(_LW('Failed to load extension %(ext_factory)s: '
'%(exc)s'),
{"ext_factory": ext_factory, "exc": exc})
LOG.warning(_LW('Failed to load extension %(ext_factory)s: '
'%(exc)s.'),
{"ext_factory": ext_factory, "exc": exc})
class ControllerExtension(object):
@ -301,9 +301,9 @@ def load_standard_extensions(ext_mgr, logger, path, package, ext_list=None):
try:
ext_mgr.load_extension(classpath)
except Exception as exc:
logger.warn(_LW('Failed to load extension %(classpath)s: '
'%(exc)s'),
{"classpath": classpath, "exc": exc})
logger.warning(_LW('Failed to load extension %(classpath)s: '
'%(exc)s.'),
{"classpath": classpath, "exc": exc})
# Now, let's consider any subdirectories we may have...
subdirs = []
@ -326,9 +326,9 @@ def load_standard_extensions(ext_mgr, logger, path, package, ext_list=None):
try:
ext(ext_mgr)
except Exception as exc:
logger.warn(_LW('Failed to load extension %(ext_name)s: '
'%(exc)s'),
{"ext_name": ext_name, "exc": exc})
logger.warning(_LW('Failed to load extension '
'%(ext_name)s: %(exc)s.'),
{"ext_name": ext_name, "exc": exc})
# Update the list of directories we'll explore...
dirnames[:] = subdirs

View File

@ -26,8 +26,10 @@ LOG = log.getLogger(__name__)
class RequestBodySizeLimiter(sizelimit.RequestBodySizeLimiter):
def __init__(self, *args, **kwargs):
LOG.warn(_LW('manila.api.sizelimit:RequestBodySizeLimiter and '
'manila.api.middleware.sizelimit:RequestBodySizeLimiter '
'are deprecated. Please use oslo_middleware.sizelimit: '
'RequestBodySizeLimiter instead.'))
LOG.warning(_LW('manila.api.sizelimit:RequestBodySizeLimiter and '
'manila.api.middleware.sizelimit:'
'RequestBodySizeLimiter '
'are deprecated. Please use '
'oslo_middleware.sizelimit: '
'RequestBodySizeLimiter instead.'))
super(RequestBodySizeLimiter, self).__init__(*args, **kwargs)

View File

@ -122,8 +122,9 @@ class APIRouter(base_wsgi.Router):
class FaultWrapper(base_wsgi.Middleware):
def __init__(self, application):
LOG.warn(_LW('manila.api.openstack:FaultWrapper is deprecated. Please '
'use manila.api.middleware.fault:FaultWrapper instead.'))
LOG.warning(_LW('manila.api.openstack:FaultWrapper is deprecated. '
'Please use '
'manila.api.middleware.fault:FaultWrapper instead.'))
# Avoid circular imports from here.
from manila.api.middleware import fault
super(FaultWrapper, self).__init__(fault.FaultWrapper(application))

View File

@ -23,6 +23,7 @@ LOG = log.getLogger(__name__)
def urlmap_factory(loader, global_conf, **local_conf):
LOG.warn(_LW('manila.api.openstack.urlmap:urlmap_factory is deprecated. '
'Please use manila.api.urlmap:urlmap_factory instead.'))
LOG.warning(_LW('manila.api.openstack.urlmap:urlmap_factory '
'is deprecated. '
'Please use manila.api.urlmap:urlmap_factory instead.'))
urlmap.urlmap_factory(loader, global_conf, **local_conf)

View File

@ -24,8 +24,10 @@ LOG = log.getLogger(__name__)
class RequestBodySizeLimiter(sizelimit.RequestBodySizeLimiter):
def __init__(self, *args, **kwargs):
LOG.warn(_LW('manila.api.sizelimit:RequestBodySizeLimiter and '
'manila.api.middleware.sizelimit:RequestBodySizeLimiter '
'are deprecated. Please use oslo_middleware.sizelimit: '
'RequestBodySizeLimiter instead.'))
LOG.warning(_LW('manila.api.sizelimit:RequestBodySizeLimiter and '
'manila.api.middleware.sizelimit:'
'RequestBodySizeLimiter '
'are deprecated. Please use '
'oslo_middleware.sizelimit: '
'RequestBodySizeLimiter instead.'))
super(RequestBodySizeLimiter, self).__init__(*args, **kwargs)

View File

@ -260,12 +260,13 @@ class ShareNetworkController(wsgi.Controller):
return (usages[name]['reserved'] + usages[name]['in_use'])
if 'share_networks' in overs:
LOG.warn(_LW("Quota exceeded for %(s_pid)s, tried to create "
"share-network (%(d_consumed)d of %(d_quota)d "
"already consumed)"), {
's_pid': context.project_id,
'd_consumed': _consumed('share_networks'),
'd_quota': quotas['share_networks']})
LOG.warning(_LW("Quota exceeded for %(s_pid)s, "
"tried to create "
"share-network (%(d_consumed)d of %(d_quota)d "
"already consumed)."), {
's_pid': context.project_id,
'd_consumed': _consumed('share_networks'),
'd_quota': quotas['share_networks']})
raise exception.ShareNetworksLimitExceeded(
allowed=quotas['share_networks'])
else:

View File

@ -110,7 +110,7 @@ class QuotaSetsMixin(object):
except (ValueError, TypeError):
msg = _("Quota '%(value)s' for %(key)s should be "
"integer.") % {'value': value, 'key': key}
LOG.warn(msg)
LOG.warning(msg)
raise webob.exc.HTTPBadRequest(explanation=msg)
LOG.debug("Force update quotas: %s.", force_update)
@ -136,7 +136,7 @@ class QuotaSetsMixin(object):
except (ValueError, TypeError):
msg = _("Quota '%(value)s' for %(key)s should be "
"integer.") % {'value': value, 'key': key}
LOG.warn(msg)
LOG.warning(msg)
raise webob.exc.HTTPBadRequest(explanation=msg)
if force_update is False and value >= 0:

View File

@ -57,8 +57,8 @@ class RequestContext(object):
user = kwargs.pop('user', None)
tenant = kwargs.pop('tenant', None)
if kwargs:
LOG.warn(_LW('Arguments dropped when creating context: %s'),
str(kwargs))
LOG.warning(_LW('Arguments dropped when creating context: %s.'),
str(kwargs))
self.user_id = user_id or user
self.project_id = project_id or tenant

View File

@ -156,7 +156,7 @@ class OVSInterfaceDriver(LinuxInterfaceDriver):
namespace_obj.add_device_to_namespace(ns_dev)
else:
LOG.warn(_LW("Device %s already exists"), device_name)
LOG.warning(_LW("Device %s already exists."), device_name)
ns_dev.link.set_up()
@device_name_synchronized
@ -201,7 +201,7 @@ class BridgeInterfaceDriver(LinuxInterfaceDriver):
else:
ns_veth = ip.device(device_name)
root_veth = ip.device(tap_name)
LOG.warn(_LW("Device %s already exists"), device_name)
LOG.warning(_LW("Device %s already exists."), device_name)
root_veth.link.set_up()
ns_veth.link.set_up()

View File

@ -492,7 +492,7 @@ class HostManager(object):
# Warn about down services and remove them from host_state_map
if not utils.service_is_up(service) or service['disabled']:
LOG.warn(_LW("Share service is down. (host: %s)") % host)
LOG.warning(_LW("Share service is down. (host: %s).") % host)
if self.host_state_map.pop(host, None):
LOG.info(_LI("Removing non-active host: %s from "
"scheduler cache.") % host)

View File

@ -194,7 +194,7 @@ class Service(service.Service):
try:
db.service_destroy(context.get_admin_context(), self.service_id)
except exception.NotFound:
LOG.warn(_LW('Service killed that has no database entry'))
LOG.warning(_LW('Service killed that has no database entry.'))
def stop(self):
# Try to shut the connection down, but if we get any sort of
@ -278,7 +278,7 @@ class WSGIService(service.ServiceBase):
self.port = getattr(CONF, '%s_listen_port' % name, 0)
self.workers = getattr(CONF, '%s_workers' % name, None)
if self.workers is not None and self.workers < 1:
LOG.warn(
LOG.warning(
_LW("Value of config option %(name)s_workers must be integer "
"greater than 1. Input value ignored.") % {'name': name})
# Reset workers to default

View File

@ -146,20 +146,22 @@ class API(base.Base):
return (usages[name]['reserved'] + usages[name]['in_use'])
if 'gigabytes' in overs:
LOG.warn(_LW("Quota exceeded for %(s_pid)s, tried to create "
"%(s_size)sG share (%(d_consumed)dG of "
"%(d_quota)dG already consumed)"), {
's_pid': context.project_id,
's_size': size,
'd_consumed': _consumed('gigabytes'),
'd_quota': quotas['gigabytes']})
LOG.warning(_LW("Quota exceeded for %(s_pid)s, "
"tried to create "
"%(s_size)sG share (%(d_consumed)dG of "
"%(d_quota)dG already consumed)."), {
's_pid': context.project_id,
's_size': size,
'd_consumed': _consumed('gigabytes'),
'd_quota': quotas['gigabytes']})
raise exception.ShareSizeExceedsAvailableQuota()
elif 'shares' in overs:
LOG.warn(_LW("Quota exceeded for %(s_pid)s, tried to create "
"share (%(d_consumed)d shares "
"already consumed)"), {
's_pid': context.project_id,
'd_consumed': _consumed('shares')})
LOG.warning(_LW("Quota exceeded for %(s_pid)s, "
"tried to create "
"share (%(d_consumed)d shares "
"already consumed)."), {
's_pid': context.project_id,
'd_consumed': _consumed('shares')})
raise exception.ShareLimitExceeded(allowed=quotas['shares'])
try:
@ -510,18 +512,18 @@ class API(base.Base):
if 'snapshot_gigabytes' in overs:
msg = _LW("Quota exceeded for %(s_pid)s, tried to create "
"%(s_size)sG snapshot (%(d_consumed)dG of "
"%(d_quota)dG already consumed)")
LOG.warn(msg, {'s_pid': context.project_id,
's_size': size,
'd_consumed': _consumed('gigabytes'),
'd_quota': quotas['snapshot_gigabytes']})
"%(d_quota)dG already consumed).")
LOG.warning(msg, {'s_pid': context.project_id,
's_size': size,
'd_consumed': _consumed('gigabytes'),
'd_quota': quotas['snapshot_gigabytes']})
raise exception.SnapshotSizeExceedsAvailableQuota()
elif 'snapshots' in overs:
msg = _LW("Quota exceeded for %(s_pid)s, tried to create "
"snapshot (%(d_consumed)d snapshots "
"already consumed)")
LOG.warn(msg, {'s_pid': context.project_id,
'd_consumed': _consumed('snapshots')})
"already consumed).")
LOG.warning(msg, {'s_pid': context.project_id,
'd_consumed': _consumed('snapshots')})
raise exception.SnapshotLimitExceeded(
allowed=quotas['snapshots'])
options = {'share_id': share['id'],
@ -824,10 +826,10 @@ class API(base.Base):
try:
self.deny_access_to_instance(ctx, share_instance, access)
except exception.NotFound:
LOG.warn(_LW("Access rule %(access_id)s not found "
"for instance %(instance_id)s.") % {
'access_id': access['id'],
'instance_id': share_instance['id']})
LOG.warning(_LW("Access rule %(access_id)s not found "
"for instance %(instance_id)s.") % {
'access_id': access['id'],
'instance_id': share_instance['id']})
else:
msg = _("Access policy should be %(active)s or in %(error)s "
"state") % {"active": constants.STATUS_ACTIVE,
@ -893,21 +895,22 @@ class API(base.Base):
for k, v in six.iteritems(metadata):
if not k:
msg = _("Metadata property key is blank")
LOG.warn(msg)
msg = _("Metadata property key is blank.")
LOG.warning(msg)
raise exception.InvalidShareMetadata(message=msg)
if len(k) > 255:
msg = _("Metadata property key is greater than 255 characters")
LOG.warn(msg)
msg = _("Metadata property key is "
"greater than 255 characters.")
LOG.warning(msg)
raise exception.InvalidShareMetadataSize(message=msg)
if not v:
msg = _("Metadata property value is blank")
LOG.warn(msg)
msg = _("Metadata property value is blank.")
LOG.warning(msg)
raise exception.InvalidShareMetadata(message=msg)
if len(v) > 1023:
msg = _("Metadata property value is "
"greater than 1023 characters")
LOG.warn(msg)
"greater than 1023 characters.")
LOG.warning(msg)
raise exception.InvalidShareMetadataSize(message=msg)
@policy.wrap_check_policy('share')

View File

@ -141,7 +141,7 @@ class IsilonStorageConnection(base.StorageConnection):
if share_id is None:
lw = _LW('Attempted to delete NFS Share "%s", but the share does '
'not appear to exist.')
LOG.warn(lw, share['name'])
LOG.warning(lw, share['name'])
else:
# attempt to delete the share
export_deleted = self._isilon_api.delete_nfs_share(share_id)
@ -156,7 +156,7 @@ class IsilonStorageConnection(base.StorageConnection):
if smb_share is None:
lw = _LW('Attempted to delete CIFS Share "%s", but the share does '
'not appear to exist.')
LOG.warn(lw, share['name'])
LOG.warning(lw, share['name'])
else:
share_deleted = self._isilon_api.delete_smb_share(share['name'])
if not share_deleted:

View File

@ -230,9 +230,9 @@ class VNXStorageConnection(driver.StorageConnection):
def delete_share(self, context, share, share_server=None):
"""Delete a share."""
if share_server is None:
LOG.warn(_LW("Driver does not support share deletion without "
"share network specified. Return directly because "
"there is nothing to clean."))
LOG.warning(_LW("Driver does not support share deletion without "
"share network specified. Return directly because "
"there is nothing to clean."))
return
share_proto = share['share_proto']

View File

@ -91,11 +91,11 @@ class StorageObject(object):
constants.STATUS_INFO):
response['maxSeverity'] = constants.STATUS_OK
LOG.warn(_LW("Translated status from %(old)s to %(new)s. "
"Message: %(info)s."),
{'old': old_Severity,
'new': response['maxSeverity'],
'info': response})
LOG.warning(_LW("Translated status from %(old)s to %(new)s. "
"Message: %(info)s."),
{'old': old_Severity,
'new': response['maxSeverity'],
'info': response})
def _response_validation(self, response, error_code):
"""Translate different status to ok/error status."""
@ -248,8 +248,8 @@ class FileSystem(StorageObject):
raise exception.EMCVnxInvalidMoverID(id=mover_id)
elif self._response_validation(
response, constants.MSG_FILESYSTEM_EXIST):
LOG.warn(_LW("File system %s already exists. Skip the creation."),
name)
LOG.warning(_LW("File system %s already exists. "
"Skip the creation."), name)
return
elif constants.STATUS_OK != response['maxSeverity']:
message = (_("Failed to create file system %(name)s. "
@ -302,8 +302,8 @@ class FileSystem(StorageObject):
def delete(self, name):
status, out = self.get(name)
if constants.STATUS_NOT_FOUND == status:
LOG.warn(_LW("File system %s not found. Skip the deletion."),
name)
LOG.warning(_LW("File system %s not found. Skip the deletion."),
name)
return
elif constants.STATUS_OK != status:
message = (_("Failed to get file system by name %(name)s. "
@ -573,8 +573,8 @@ class MountPoint(StorageObject):
self.xml_retry = True
raise exception.EMCVnxInvalidMoverID(id=mover_id)
elif self._is_mount_point_already_existent(response):
LOG.warn(_LW("Mount Point %(mount)s already exists. "
"Skip the creation."), {'mount': mount_path})
LOG.warning(_LW("Mount Point %(mount)s already exists. "
"Skip the creation."), {'mount': mount_path})
return
elif constants.STATUS_OK != response['maxSeverity']:
message = (_('Failed to create Mount Point %(mount)s for '
@ -639,9 +639,9 @@ class MountPoint(StorageObject):
self.xml_retry = True
raise exception.EMCVnxInvalidMoverID(id=mover_id)
elif self._is_mount_point_nonexistent(response):
LOG.warn(_LW('Mount point %(mount)s on mover %(mover_name)s '
'not found.'),
{'mount': mount_path, 'mover_name': mover_name})
LOG.warning(_LW('Mount point %(mount)s on mover %(mover_name)s '
'not found.'),
{'mount': mount_path, 'mover_name': mover_name})
return
elif constants.STATUS_OK != response['maxSeverity']:
@ -871,8 +871,8 @@ class VDM(StorageObject):
self.xml_retry = True
raise exception.EMCVnxInvalidMoverID(id=mover_id)
elif self._response_validation(response, constants.MSG_VDM_EXIST):
LOG.warn(_LW("VDM %(name)s already exists. Skip the creation."),
{'name': name})
LOG.warning(_LW("VDM %(name)s already exists. Skip the creation."),
{'name': name})
elif constants.STATUS_OK != response['maxSeverity']:
message = (_("Failed to create VDM %(name)s on mover "
"%(mover_name)s. Reason: %(err)s.") %
@ -915,8 +915,8 @@ class VDM(StorageObject):
def delete(self, name):
status, out = self.get(name)
if constants.STATUS_NOT_FOUND == status:
LOG.warn(_LW("VDM %s not found. Skip the deletion."),
name)
LOG.warning(_LW("VDM %s not found. Skip the deletion."),
name)
return
elif constants.STATUS_OK != status:
message = (_("Failed to get VDM by name %(name)s. "
@ -1050,9 +1050,9 @@ class Snapshot(StorageObject):
response = self._send_request(request)
if self._response_validation(response, constants.MSG_SNAP_EXIST):
LOG.warn(_LW("Snapshot %(name)s already exists. "
"Skip the creation."),
{'name': name})
LOG.warning(_LW("Snapshot %(name)s already exists. "
"Skip the creation."),
{'name': name})
elif constants.STATUS_OK != response['maxSeverity']:
message = (_("Failed to create snapshot %(name)s on "
"filesystem %(fs_name)s. Reason: %(err)s.") %
@ -1095,8 +1095,8 @@ class Snapshot(StorageObject):
def delete(self, name):
status, out = self.get(name)
if constants.STATUS_NOT_FOUND == status:
LOG.warn(_LW("Snapshot %s not found. Skip the deletion."),
name)
LOG.warning(_LW("Snapshot %s not found. Skip the deletion."),
name)
return
elif constants.STATUS_OK != status:
message = (_("Failed to get snapshot by name %(name)s. "
@ -1179,13 +1179,13 @@ class MoverInterface(StorageObject):
raise exception.EMCVnxInvalidMoverID(id=mover_id)
elif self._response_validation(
response, constants.MSG_INTERFACE_NAME_EXIST):
LOG.warn(_LW("Mover interface name %s already exists. "
"Skip the creation."), name)
LOG.warning(_LW("Mover interface name %s already exists. "
"Skip the creation."), name)
return
elif self._response_validation(
response, constants.MSG_INTERFACE_EXIST):
LOG.warn(_LW("Mover interface IP %s already exists. "
"Skip the creation."), ip_addr)
LOG.warning(_LW("Mover interface IP %s already exists. "
"Skip the creation."), ip_addr)
return
elif self._response_validation(
response, constants.MSG_INTERFACE_INVALID_VLAN_ID):
@ -1245,8 +1245,8 @@ class MoverInterface(StorageObject):
raise exception.EMCVnxInvalidMoverID(id=mover_id)
elif self._response_validation(
response, constants.MSG_INTERFACE_NON_EXISTENT):
LOG.warn(_LW("Mover interface %s not found. Skip the deletion."),
ip_addr)
LOG.warning(_LW("Mover interface %s not found. "
"Skip the deletion."), ip_addr)
return
elif constants.STATUS_OK != response['maxSeverity']:
message = (_("Failed to delete mover interface %(ip)s on mover "
@ -1315,9 +1315,9 @@ class DNSDomain(StorageObject):
self.xml_retry = True
raise exception.EMCVnxInvalidMoverID(id=mover_id)
elif constants.STATUS_OK != response['maxSeverity']:
LOG.warn(_LW("Failed to delete DNS domain %(name)s. "
"Reason: %(err)s."),
{'name': name, 'err': response['problems']})
LOG.warning(_LW("Failed to delete DNS domain %(name)s. "
"Reason: %(err)s."),
{'name': name, 'err': response['problems']})
@vnx_utils.decorate_all_methods(vnx_utils.log_enter_exit,
@ -1507,14 +1507,14 @@ class CIFSServer(StorageObject):
status, out = self.get(
computer_name.lower(), mover_name, is_vdm, self.xml_retry)
if constants.STATUS_NOT_FOUND == status:
LOG.warn(_LW("CIFS server %(name)s on mover %(mover_name)s "
"not found. Skip the deletion."),
{'name': computer_name, 'mover_name': mover_name})
LOG.warning(_LW("CIFS server %(name)s on mover %(mover_name)s "
"not found. Skip the deletion."),
{'name': computer_name, 'mover_name': mover_name})
return
except exception.EMCVnxXMLAPIError:
LOG.warn(_LW("CIFS server %(name)s on mover %(mover_name)s "
"not found. Skip the deletion."),
{'name': computer_name, 'mover_name': mover_name})
LOG.warning(_LW("CIFS server %(name)s on mover %(mover_name)s "
"not found. Skip the deletion."),
{'name': computer_name, 'mover_name': mover_name})
return
server_name = out['name']
@ -1605,8 +1605,8 @@ class CIFSShare(StorageObject):
def delete(self, name, mover_name, is_vdm=True):
status, out = self.get(name)
if constants.STATUS_NOT_FOUND == status:
LOG.warn(_LW("CIFS share %s not found. Skip the deletion."),
name)
LOG.warning(_LW("CIFS share %s not found. Skip the deletion."),
name)
return
elif constants.STATUS_OK != status:
message = (_("Failed to get CIFS share by name %(name)s. "
@ -1683,8 +1683,8 @@ class CIFSShare(StorageObject):
dup_msg = re.compile(r'ACE for %(domain)s\\%(user)s unchanged' %
{'domain': domain, 'user': user_name}, re.I)
if re.search(dup_msg, expt.stdout):
LOG.warn(_LW("Duplicate access control entry, "
"skipping allow..."))
LOG.warning(_LW("Duplicate access control entry, "
"skipping allow..."))
else:
message = (_('Failed to allow the access %(access)s to '
'CIFS share %(name)s. Reason: %(err)s.') %
@ -1715,10 +1715,10 @@ class CIFSShare(StorageObject):
% {'domain': domain, 'user': user_name}, re.I)
if re.search(not_found_msg, expt.stdout):
LOG.warn(_LW("No access control entry found, "
"skipping deny..."))
LOG.warning(_LW("No access control entry found, "
"skipping deny..."))
elif re.search(user_err_msg, expt.stdout):
LOG.warn(_LW("User not found on domain, skipping deny..."))
LOG.warning(_LW("User not found on domain, skipping deny..."))
else:
message = (_('Failed to deny the access %(access)s to '
'CIFS share %(name)s. Reason: %(err)s.') %
@ -1756,7 +1756,8 @@ class NFSShare(StorageObject):
status, out = self.get(name, mover_name)
if constants.STATUS_NOT_FOUND == status:
LOG.warn(_LW("NFS share %s not found. Skip the deletion."), path)
LOG.warning(_LW("NFS share %s not found. Skip the deletion."),
path)
return
delete_nfs_share_cmd = [
@ -1806,7 +1807,7 @@ class NFSShare(StorageObject):
dup_msg = (r'%(mover_name)s : No such file or directory' %
{'mover_name': mover_name})
if re.search(dup_msg, expt.stdout):
LOG.warn(_LW("NFS share %s not found."), name)
LOG.warning(_LW("NFS share %s not found."), name)
return constants.STATUS_NOT_FOUND, None
else:
message = (_('Failed to list NFS share %(name)s on '

View File

@ -232,7 +232,7 @@ def _mount_gluster_vol(execute, gluster_export, mount_path, ensure=False):
execute(*command, run_as_root=True)
except exception.ProcessExecutionError as exc:
if ensure and 'already mounted' in exc.stderr:
LOG.warn(_LW("%s is already mounted"), gluster_export)
LOG.warning(_LW("%s is already mounted."), gluster_export)
else:
raise exception.GlusterfsException(
'Unable to mount Gluster volume'

View File

@ -257,11 +257,11 @@ class GlusterfsVolumeMappedLayout(layout.GlusterfsShareLayoutBase):
if not unused_vols:
# No volumes available for use as share. Warn user.
LOG.warn(_LW("No unused gluster volumes available for use as "
"share! Create share won't be supported unless "
"existing shares are deleted or some gluster "
"volumes are created with names matching "
"'glusterfs_volume_pattern'."))
LOG.warning(_LW("No unused gluster volumes available for use as "
"share! Create share won't be supported unless "
"existing shares are deleted or some gluster "
"volumes are created with names matching "
"'glusterfs_volume_pattern'."))
else:
LOG.info(_LI("Number of gluster volumes in use: "
"%(inuse-numvols)s. Number of gluster volumes "

View File

@ -179,11 +179,11 @@ class GlusterfsNativeShareDriver(driver.ExecuteMixin,
ssl_allow = re.split('[ ,]', ssl_allow_opt)
access_to = access['access_to']
if access_to in ssl_allow:
LOG.warn(_LW("Access to %(share)s at %(export)s is already "
"granted for %(access_to)s. GlusterFS volume "
"options might have been changed externally."),
{'share': share['id'], 'export': gluster_mgr.qualified,
'access_to': access_to})
LOG.warning(_LW("Access to %(share)s at %(export)s is already "
"granted for %(access_to)s. GlusterFS volume "
"options might have been changed externally."),
{'share': share['id'], 'export': gluster_mgr.qualified,
'access_to': access_to})
return
ssl_allow.append(access_to)
@ -219,11 +219,11 @@ class GlusterfsNativeShareDriver(driver.ExecuteMixin,
ssl_allow = re.split('[ ,]', ssl_allow_opt)
access_to = access['access_to']
if access_to not in ssl_allow:
LOG.warn(_LW("Access to %(share)s at %(export)s is already "
"denied for %(access_to)s. GlusterFS volume "
"options might have been changed externally."),
{'share': share['id'], 'export': gluster_mgr.qualified,
'access_to': access_to})
LOG.warning(_LW("Access to %(share)s at %(export)s is already "
"denied for %(access_to)s. GlusterFS volume "
"options might have been changed externally."),
{'share': share['id'], 'export': gluster_mgr.qualified,
'access_to': access_to})
return
ssl_allow.remove(access_to)

View File

@ -234,19 +234,20 @@ class WindowsServiceInstanceManager(service_instance.ServiceInstanceManager):
if not security_services:
LOG.info(_LI("No security services provided."))
elif len(security_services) > 1:
LOG.warn(_LW("Multiple security services provided. Only one "
"security service of type 'active_directory' "
"is supported."))
LOG.warning(_LW("Multiple security services provided. Only one "
"security service of type 'active_directory' "
"is supported."))
else:
security_service = security_services[0]
security_service_type = security_service['type']
if security_service_type == 'active_directory':
return security_service
else:
LOG.warn(_LW("Only security services of type "
"'active_directory' are supported. "
"Retrieved security service type: %(sec_type)s"),
{'sec_type': security_service_type})
LOG.warning(_LW("Only security services of type "
"'active_directory' are supported. "
"Retrieved security "
"service type: %(sec_type)s."),
{'sec_type': security_service_type})
return None
def _run_cloudbase_init_plugin_after_reboot(self, server, plugin_name):

View File

@ -67,12 +67,12 @@ class WindowsSMBDriver(generic.GenericShareDriver):
security_service['user'],
security_service['password'])
except Exception as exc:
LOG.warn(_LW("Failed to remove service instance "
"%(instance_id)s from domain %(domain)s. "
"Exception: %(exc)s"),
dict(instance_id=server_details['instance_id'],
domain=security_service['domain'],
exc=exc))
LOG.warning(_LW("Failed to remove service instance "
"%(instance_id)s from domain %(domain)s. "
"Exception: %(exc)s."),
dict(instance_id=server_details['instance_id'],
domain=security_service['domain'],
exc=exc))
super(WindowsSMBDriver, self)._teardown_server(server_details,
security_services)

View File

@ -83,7 +83,7 @@ class _IntegratedTestBase(test.TestCase):
# FIXME(ja): this is not the auth url - this is the service url
# FIXME(ja): this needs fixed in nova as well
self.auth_url = 'http://%s:%s/v1' % (self.osapi.host, self.osapi.port)
LOG.warn(self.auth_url)
LOG.warning(self.auth_url)
def _get_flags(self):
"""An opportunity to setup flags, before the services are started."""

View File

@ -209,7 +209,7 @@ class TestBridgeInterfaceDriver(TestBase):
def test_plug_dev_exists(self):
self.device_exists.return_value = True
with mock.patch('manila.network.linux.interface.LOG.warn') as log:
with mock.patch('manila.network.linux.interface.LOG.warning') as log:
br = interface.BridgeInterfaceDriver()
br.plug('port-1234',
'tap0',

View File

@ -169,7 +169,7 @@ class HostManagerTestCase(test.TestCase):
self.mock_object(
db, 'service_get_all_by_topic',
mock.Mock(return_value=fakes.SHARE_SERVICES_NO_POOLS))
host_manager.LOG.warn = mock.Mock()
host_manager.LOG.warning = mock.Mock()
with mock.patch.dict(self.host_manager.service_states,
fakes.SERVICE_STATES_NO_POOLS):
@ -259,7 +259,7 @@ class HostManagerTestCase(test.TestCase):
self.mock_object(
db, 'service_get_all_by_topic',
mock.Mock(return_value=fakes.SHARE_SERVICES_WITH_POOLS))
host_manager.LOG.warn = mock.Mock()
host_manager.LOG.warning = mock.Mock()
with mock.patch.dict(self.host_manager.service_states,
fakes.SHARE_SERVICE_STATES_WITH_POOLS):
@ -401,7 +401,7 @@ class HostManagerTestCase(test.TestCase):
self.mock_object(
db, 'service_get_all_by_topic',
mock.Mock(return_value=fakes.SHARE_SERVICES_NO_POOLS))
host_manager.LOG.warn = mock.Mock()
host_manager.LOG.warning = mock.Mock()
with mock.patch.dict(self.host_manager.service_states,
fakes.SERVICE_STATES_NO_POOLS):
@ -483,7 +483,7 @@ class HostManagerTestCase(test.TestCase):
self.mock_object(
db, 'service_get_all_by_topic',
mock.Mock(return_value=fakes.SHARE_SERVICES_WITH_POOLS))
host_manager.LOG.warn = mock.Mock()
host_manager.LOG.warning = mock.Mock()
with mock.patch.dict(self.host_manager.service_states,
fakes.SHARE_SERVICE_STATES_WITH_POOLS):

View File

@ -347,14 +347,14 @@ class GlusterFSCommonTestCase(test.TestCase):
def exec_runner(*ignore_args, **ignore_kwargs):
raise exception.ProcessExecutionError(stderr='already mounted')
expected_exec = self._mount_exec(fakeexport, fakemnt)
common.LOG.warn = mock.Mock()
common.LOG.warning = mock.Mock()
fake_utils.fake_execute_set_repliers([('mount', exec_runner)])
ret = common._mount_gluster_vol(self._execute, fakeexport, fakemnt,
True)
self.assertEqual(fake_utils.fake_execute_get_log(), expected_exec)
self.assertIsNone(ret)
common.LOG.warn.assert_called_with(
"%s is already mounted", fakeexport)
common.LOG.warning.assert_called_with(
"%s is already mounted.", fakeexport)
@ddt.data(True, False)
def test_mount_gluster_vol_fail(self, ensure):

View File

@ -278,7 +278,7 @@ class GlusterfsVolumeMappedLayoutTestCase(test.TestCase):
mock.Mock(return_value=self.glusterfs_volumes_dict))
self.mock_object(self._layout, '_check_mount_glusterfs')
self._layout.gluster_used_vols = self.glusterfs_used_vols
self.mock_object(layout_volume.LOG, 'warn')
self.mock_object(layout_volume.LOG, 'warning')
self._layout.do_setup(self._context)

View File

@ -69,7 +69,7 @@ class ContextTestCase(test.TestCase):
def fake_warn(log_msg, other_args):
info['log_msg'] = log_msg % other_args
self.mock_object(context.LOG, 'warn', fake_warn)
self.mock_object(context.LOG, 'warning', fake_warn)
c = context.RequestContext('user',
'project',

View File

@ -613,8 +613,8 @@ class BaseSharesTest(test.BaseTestCase):
client.delete_cgsnapshot(res_id)
client.wait_for_resource_deletion(cgsnapshot_id=res_id)
else:
LOG.warn("Provided unsupported resource type for "
"cleanup '%s'. Skipping." % res["type"])
LOG.warning("Provided unsupported resource type for "
"cleanup '%s'. Skipping." % res["type"])
res["deleted"] = True
@classmethod