Change LOG.warn to LOG.warning

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: I3a057080b7b888b2c246ad9910ddba564b07dbd9
Closes-Bug: #1530742
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index aa8ee3f..eaef598 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -278,8 +278,8 @@
             # into the delete_volume method as a convenience to the caller.
             volumes_client.wait_for_resource_deletion(volume_id)
         except lib_exc.NotFound:
-            LOG.warn("Unable to delete volume '%s' since it was not found. "
-                     "Maybe it was already deleted?" % volume_id)
+            LOG.warning("Unable to delete volume '%s' since it was not found. "
+                        "Maybe it was already deleted?" % volume_id)
 
     @classmethod
     def prepare_instance_network(cls):
diff --git a/tempest/cmd/account_generator.py b/tempest/cmd/account_generator.py
index b90ee04..5a2713b 100755
--- a/tempest/cmd/account_generator.py
+++ b/tempest/cmd/account_generator.py
@@ -201,7 +201,8 @@
         if tenant not in existing:
             tenants_admin.create_tenant(tenant)
         else:
-            LOG.warn("Tenant '%s' already exists in this environment" % tenant)
+            LOG.warning("Tenant '%s' already exists in this environment"
+                        % tenant)
     LOG.info('Tenants created')
     for u in resources['users']:
         try:
@@ -220,8 +221,8 @@
                     enabled=True)
                 break
             else:
-                LOG.warn("User '%s' already exists in this environment. "
-                         "New name generated" % u['name'])
+                LOG.warning("User '%s' already exists in this environment. "
+                            "New name generated" % u['name'])
                 u['name'] = random_user_name(opts.tag, u['prefix'])
 
     LOG.info('Users created')
diff --git a/tempest/cmd/javelin.py b/tempest/cmd/javelin.py
index fd35eab..6dfa0a7 100755
--- a/tempest/cmd/javelin.py
+++ b/tempest/cmd/javelin.py
@@ -311,7 +311,8 @@
         if tenant not in existing:
             admin.tenants.create_tenant(tenant)['tenant']
         else:
-            LOG.warn("Tenant '%s' already exists in this environment" % tenant)
+            LOG.warning("Tenant '%s' already exists in this environment"
+                        % tenant)
 
 
 def destroy_tenants(tenants):
@@ -376,8 +377,8 @@
         try:
             identity.get_user_by_username(admin.identity,
                                           tenant['id'], u['name'])
-            LOG.warn("User '%s' already exists in this environment"
-                     % u['name'])
+            LOG.warning("User '%s' already exists in this environment"
+                        % u['name'])
         except lib_exc.NotFound:
             admin.identity.create_user(
                 u['name'], u['pass'], tenant['id'],
@@ -1074,7 +1075,7 @@
     destroy_secgroups(RES['secgroups'])
     destroy_users(RES['users'])
     destroy_tenants(RES['tenants'])
-    LOG.warn("Destroy mode incomplete")
+    LOG.warning("Destroy mode incomplete")
 
 
 def get_options():
diff --git a/tempest/common/dynamic_creds.py b/tempest/common/dynamic_creds.py
index 5bbc93c..0af07f0 100644
--- a/tempest/common/dynamic_creds.py
+++ b/tempest/common/dynamic_creds.py
@@ -285,24 +285,24 @@
         try:
             net_client.delete_router(router_id)
         except lib_exc.NotFound:
-            LOG.warn('router with name: %s not found for delete' %
-                     router_name)
+            LOG.warning('router with name: %s not found for delete' %
+                        router_name)
 
     def _clear_isolated_subnet(self, subnet_id, subnet_name):
         client = self.subnets_admin_client
         try:
             client.delete_subnet(subnet_id)
         except lib_exc.NotFound:
-            LOG.warn('subnet with name: %s not found for delete' %
-                     subnet_name)
+            LOG.warning('subnet with name: %s not found for delete' %
+                        subnet_name)
 
     def _clear_isolated_network(self, network_id, network_name):
         net_client = self.networks_admin_client
         try:
             net_client.delete_network(network_id)
         except lib_exc.NotFound:
-            LOG.warn('network with name: %s not found for delete' %
-                     network_name)
+            LOG.warning('network with name: %s not found for delete' %
+                        network_name)
 
     def _cleanup_default_secgroup(self, tenant):
         nsg_client = self.security_groups_admin_client
@@ -313,8 +313,8 @@
             try:
                 nsg_client.delete_security_group(secgroup['id'])
             except lib_exc.NotFound:
-                LOG.warn('Security group %s, id %s not found for clean-up' %
-                         (secgroup['name'], secgroup['id']))
+                LOG.warning('Security group %s, id %s not found for clean-up' %
+                            (secgroup['name'], secgroup['id']))
 
     def _clear_isolated_net_resources(self):
         net_client = self.network_admin_client
@@ -333,8 +333,8 @@
                     net_client.remove_router_interface_with_subnet_id(
                         creds.router['id'], creds.subnet['id'])
                 except lib_exc.NotFound:
-                    LOG.warn('router with name: %s not found for delete' %
-                             creds.router['name'])
+                    LOG.warning('router with name: %s not found for delete' %
+                                creds.router['name'])
                 self._clear_isolated_router(creds.router['id'],
                                             creds.router['name'])
             if (not self.network_resources or
@@ -354,15 +354,15 @@
             try:
                 self.creds_client.delete_user(creds.user_id)
             except lib_exc.NotFound:
-                LOG.warn("user with name: %s not found for delete" %
-                         creds.username)
+                LOG.warning("user with name: %s not found for delete" %
+                            creds.username)
             try:
                 if CONF.service_available.neutron:
                     self._cleanup_default_secgroup(creds.tenant_id)
                 self.creds_client.delete_project(creds.tenant_id)
             except lib_exc.NotFound:
-                LOG.warn("tenant with name: %s not found for delete" %
-                         creds.tenant_name)
+                LOG.warning("tenant with name: %s not found for delete" %
+                            creds.tenant_name)
         self._creds = {}
 
     def is_multi_user(self):
diff --git a/tempest/common/fixed_network.py b/tempest/common/fixed_network.py
index 56cd331..3fc1365 100644
--- a/tempest/common/fixed_network.py
+++ b/tempest/common/fixed_network.py
@@ -49,13 +49,13 @@
                    name, networks))
         if caller:
             msg = '(%s) %s' % (caller, msg)
-        LOG.warn(msg)
+        LOG.warning(msg)
         raise exceptions.InvalidTestResource(type='network', name=name)
     else:
         msg = "Network with name: %s not found" % name
         if caller:
             msg = '(%s) %s' % (caller, msg)
-        LOG.warn(msg)
+        LOG.warning(msg)
         raise exceptions.InvalidTestResource(type='network', name=name)
     # To be consistent between neutron and nova network always use name even
     # if label is used in the api response. If neither is present than then
@@ -65,7 +65,7 @@
         msg = "Network found from list doesn't contain a valid name or label"
         if caller:
             msg = '(%s) %s' % (caller, msg)
-        LOG.warn(msg)
+        LOG.warning(msg)
         raise exceptions.InvalidTestResource(type='network', name=name)
     network['name'] = name
     return network
@@ -122,6 +122,6 @@
         if 'id' in network.keys():
             params.update({"networks": [{'uuid': network['id']}]})
         else:
-            LOG.warn('The provided network dict: %s was invalid and did not '
-                     ' contain an id' % network)
+            LOG.warning('The provided network dict: %s was invalid and did '
+                        'not contain an id' % network)
     return params
diff --git a/tempest/common/validation_resources.py b/tempest/common/validation_resources.py
index f526299..bb71a51 100644
--- a/tempest/common/validation_resources.py
+++ b/tempest/common/validation_resources.py
@@ -73,8 +73,8 @@
             try:
                 keypair_client.delete_keypair(keypair_name)
             except lib_exc.NotFound:
-                LOG.warn("Keypair %s is not found when attempting to delete"
-                         % keypair_name)
+                LOG.warning("Keypair %s is not found when attempting to delete"
+                            % keypair_name)
             except Exception as exc:
                 LOG.exception('Exception raised while deleting key %s'
                               % keypair_name)
@@ -87,8 +87,8 @@
                 security_group_client.delete_security_group(sec_id)
                 security_group_client.wait_for_resource_deletion(sec_id)
             except lib_exc.NotFound:
-                LOG.warn("Security group %s is not found when attempting to "
-                         " delete" % sec_id)
+                LOG.warning("Security group %s is not found when attempting "
+                            "to delete" % sec_id)
             except lib_exc.Conflict as exc:
                 LOG.exception('Conflict while deleting security '
                               'group %s VM might not be deleted ' % sec_id)
@@ -105,8 +105,8 @@
             try:
                 floating_client.delete_floating_ip(fip_id)
             except lib_exc.NotFound:
-                LOG.warn('Floating ip %s not found while attempting to delete'
-                         % fip_id)
+                LOG.warning('Floating ip %s not found while attempting to '
+                            'delete' % fip_id)
             except Exception as exc:
                 LOG.exception('Exception raised while deleting ip %s '
                               % fip_id)
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 8a00c65..533fda9 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -932,8 +932,8 @@
             try:
                 source.ping_host(dest, nic=nic)
             except lib_exc.SSHExecCommandFailed:
-                LOG.warn('Failed to ping IP: %s via a ssh connection from: %s.'
-                         % (dest, source.ssh_client.host))
+                LOG.warning('Failed to ping IP: %s via a ssh connection '
+                            'from: %s.' % (dest, source.ssh_client.host))
                 return not should_succeed
             return should_succeed
 
diff --git a/tempest/stress/driver.py b/tempest/stress/driver.py
index 4dcaab7..a3e1ea3 100644
--- a/tempest/stress/driver.py
+++ b/tempest/stress/driver.py
@@ -106,7 +106,7 @@
         if process['process'].is_alive():
             try:
                 pid = process['process'].pid
-                LOG.warn("Process %d hangs. Send SIGKILL." % pid)
+                LOG.warning("Process %d hangs. Send SIGKILL." % pid)
                 os.kill(pid, signal.SIGKILL)
             except Exception:
                 pass
diff --git a/tempest/test.py b/tempest/test.py
index 407df3b..43cf9e8 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -375,8 +375,8 @@
             cls.validation_resources = vresources.create_validation_resources(
                 cls.os, cls.validation_resources)
         else:
-            LOG.warn("Client manager not found, validation resources not"
-                     " created")
+            LOG.warning("Client manager not found, validation resources not"
+                        " created")
 
     @classmethod
     def resource_cleanup(cls):
@@ -391,8 +391,8 @@
                                                       cls.validation_resources)
                 cls.validation_resources = {}
             else:
-                LOG.warn("Client manager not found, validation resources not"
-                         " deleted")
+                LOG.warning("Client manager not found, validation resources "
+                            "not deleted")
 
     def setUp(self):
         super(BaseTestCase, self).setUp()