diff options
author | LiuNanke <nanke.liu@easystack.cn> | 2015-12-29 12:54:49 +0800 |
---|---|---|
committer | LiuNanke <nanke.liu@easystack.cn> | 2015-12-29 09:32:42 +0000 |
commit | 208d2debd0459ad5ce27884f8f4bbc3c1979ab18 (patch) | |
tree | d0719d6ee8d22a3c6211ba0b158333cbf3061128 /contrib | |
parent | e7ec1982cc65f3c6e81bd7edfd9063a01ec2572d (diff) | |
download | heat-208d2debd0459ad5ce27884f8f4bbc3c1979ab18.tar.gz |
Using LOG.warning replace LOG.warn
*Python 3 deprecated the logger.warn method, see:
*https://docs.python.org/3/library/logging.html#logging.warning
*so we prefer to use warning to avoid DeprecationWarning.
Change-Id: I07ee9c97c3548c965aaf83d34b37b23e9baba584
Diffstat (limited to 'contrib')
5 files changed, 10 insertions, 8 deletions
diff --git a/contrib/heat_docker/heat_docker/resources/docker_container.py b/contrib/heat_docker/heat_docker/resources/docker_container.py index 1ba0c82eb..a87fc6ec2 100644 --- a/contrib/heat_docker/heat_docker/resources/docker_container.py +++ b/contrib/heat_docker/heat_docker/resources/docker_container.py @@ -550,7 +550,8 @@ def available_resource_mapping(): if DOCKER_INSTALLED: return resource_mapping() else: - LOG.warn(_LW("Docker plug-in loaded, but docker lib not installed.")) + LOG.warning(_LW("Docker plug-in loaded, but docker lib " + "not installed.")) return {} diff --git a/contrib/rackspace/heat_keystoneclient_v2/client.py b/contrib/rackspace/heat_keystoneclient_v2/client.py index aa23b9f75..66bc8d431 100644 --- a/contrib/rackspace/heat_keystoneclient_v2/client.py +++ b/contrib/rackspace/heat_keystoneclient_v2/client.py @@ -156,8 +156,8 @@ class KeystoneClientV2(object): Returns the keystone ID of the resulting user """ if len(username) > 64: - LOG.warn(_LW("Truncating the username %s to the last 64 " - "characters."), username) + LOG.warning(_LW("Truncating the username %s to the last 64 " + "characters."), username) # get the last 64 characters of the username username = username[-64:] user = self.client.users.create(username, diff --git a/contrib/rackspace/rackspace/clients.py b/contrib/rackspace/rackspace/clients.py index dd737b6ec..676d3c9e3 100644 --- a/contrib/rackspace/rackspace/clients.py +++ b/contrib/rackspace/rackspace/clients.py @@ -65,7 +65,7 @@ class RackspaceClientPlugin(client_plugin.ClientPlugin): tenant_id=tenant, tenant_name=tenant_name) if not self.pyrax.authenticated: - LOG.warn(_LW("Pyrax Authentication Failed.")) + LOG.warning(_LW("Pyrax Authentication Failed.")) raise exception.AuthorizationFailure() LOG.info(_LI("User %s authenticated successfully."), self.context.username) diff --git a/contrib/rackspace/rackspace/resources/cloud_server.py b/contrib/rackspace/rackspace/resources/cloud_server.py index d6879d6bf..e0bced190 100644 --- a/contrib/rackspace/rackspace/resources/cloud_server.py +++ b/contrib/rackspace/rackspace/resources/cloud_server.py @@ -147,7 +147,8 @@ class CloudServer(server.Server): reason = server.metadata.get('rackconnect_unprocessable_reason', None) if reason is not None: - LOG.warn(_LW("RackConnect unprocessable reason: %s"), reason) + LOG.warning(_LW("RackConnect unprocessable reason: %s"), + reason) msg = _("RackConnect automation has completed") self._add_event(self.action, self.status, msg) diff --git a/contrib/rackspace/rackspace/resources/cloudnetworks.py b/contrib/rackspace/rackspace/resources/cloudnetworks.py index 1eb0a9d6d..e171bff91 100644 --- a/contrib/rackspace/rackspace/resources/cloudnetworks.py +++ b/contrib/rackspace/rackspace/resources/cloudnetworks.py @@ -108,8 +108,8 @@ class CloudNetwork(resource.Resource): try: self._network = self.cloud_networks().get(self.resource_id) except NotFound: - LOG.warn(_LW("Could not find network %s but resource id is" - " set."), self.resource_id) + LOG.warning(_LW("Could not find network %s but resource id is" + " set."), self.resource_id) return self._network def cloud_networks(self): @@ -139,7 +139,7 @@ class CloudNetwork(resource.Resource): try: network.delete() except NetworkInUse: - LOG.warn(_LW("Network '%s' still in use."), network.id) + LOG.warning(_LW("Network '%s' still in use."), network.id) else: self._delete_issued = True return False |