summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGábor Antal <antal@inf.u-szeged.hu>2017-03-28 16:47:28 +0200
committerAkihiro Motoki <amotoki@gmail.com>2017-03-31 20:59:16 +0900
commit34a3aa0ba8783c5cc191fff730a164d377d4c89f (patch)
treee644c96ab4030620dd40529825189bf68e82ce59
parenta3e28c1b6c01909ea401aadd4a0f93f2610a6a55 (diff)
Handle log message interpolation by the logger
According to OpenStack Guideline[1], logged string message should be interpolated by the logger. [1]: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#adding-variables-to-log-messages Change-Id: I51f50935f1eeffe4960562d6309dfdf05814e595 Closes-Bug: #1596829
Notes
Notes (review): Code-Review+1: Gábor Antal <antal@inf.u-szeged.hu> Code-Review+2: Akihiro Motoki <amotoki@gmail.com> Workflow+1: Akihiro Motoki <amotoki@gmail.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 31 Mar 2017 13:28:44 +0000 Reviewed-on: https://review.openstack.org/428686 Project: openstack/horizon Branch: refs/heads/master
-rw-r--r--horizon/base.py5
-rw-r--r--horizon/middleware/base.py4
-rw-r--r--horizon/tables/actions.py23
-rw-r--r--horizon/tables/base.py4
-rw-r--r--horizon/test/helpers.py2
-rw-r--r--horizon/utils/file_discovery.py6
-rw-r--r--openstack_dashboard/api/glance.py9
-rw-r--r--openstack_dashboard/api/keystone.py13
-rw-r--r--openstack_dashboard/api/neutron.py65
-rw-r--r--openstack_dashboard/api/nova.py6
-rw-r--r--openstack_dashboard/dashboards/admin/floating_ips/tables.py2
-rw-r--r--openstack_dashboard/dashboards/admin/images/views.py12
-rw-r--r--openstack_dashboard/dashboards/admin/networks/forms.py3
-rw-r--r--openstack_dashboard/dashboards/admin/networks/ports/forms.py2
-rw-r--r--openstack_dashboard/dashboards/identity/domains/tables.py6
-rw-r--r--openstack_dashboard/dashboards/identity/domains/workflows.py4
-rw-r--r--openstack_dashboard/dashboards/identity/groups/forms.py2
-rw-r--r--openstack_dashboard/dashboards/identity/groups/tables.py10
-rw-r--r--openstack_dashboard/dashboards/identity/projects/workflows.py2
-rw-r--r--openstack_dashboard/dashboards/identity/users/forms.py4
-rw-r--r--openstack_dashboard/dashboards/identity/users/views.py5
-rw-r--r--openstack_dashboard/dashboards/project/floating_ips/tables.py2
-rw-r--r--openstack_dashboard/dashboards/project/instances/views.py6
-rw-r--r--openstack_dashboard/dashboards/project/instances/workflows/create_instance.py4
-rw-r--r--openstack_dashboard/dashboards/project/networks/ports/forms.py2
-rw-r--r--openstack_dashboard/dashboards/project/networks/subnets/workflows.py3
-rw-r--r--openstack_dashboard/dashboards/project/networks/workflows.py8
-rw-r--r--openstack_dashboard/dashboards/project/stacks/forms.py2
-rw-r--r--openstack_dashboard/dashboards/project/stacks/tabs.py4
-rw-r--r--openstack_dashboard/dashboards/project/vpn/forms.py8
-rw-r--r--openstack_dashboard/django_pyscss_fix/__init__.py3
-rw-r--r--openstack_dashboard/settings.py2
-rw-r--r--openstack_dashboard/theme_settings.py2
-rw-r--r--openstack_dashboard/utils/settings.py2
34 files changed, 127 insertions, 110 deletions
diff --git a/horizon/base.py b/horizon/base.py
index f9f9d85..0a4ec13 100644
--- a/horizon/base.py
+++ b/horizon/base.py
@@ -309,7 +309,8 @@ class Panel(HorizonComponent):
309 except Exception as exc: 309 except Exception as exc:
310 # Logging here since this will often be called in a template 310 # Logging here since this will often be called in a template
311 # where the exception would be hidden. 311 # where the exception would be hidden.
312 LOG.info("Error reversing absolute URL for %s: %s" % (self, exc)) 312 LOG.info("Error reversing absolute URL for %(self)s: %(exc)s",
313 {'self': self, 'exc': exc})
313 raise 314 raise
314 315
315 @property 316 @property
@@ -524,7 +525,7 @@ class Dashboard(Registry, HorizonComponent):
524 except Exception: 525 except Exception:
525 # Logging here since this will often be called in a template 526 # Logging here since this will often be called in a template
526 # where the exception would be hidden. 527 # where the exception would be hidden.
527 LOG.exception("Error reversing absolute URL for %s." % self) 528 LOG.exception("Error reversing absolute URL for %s.", self)
528 raise 529 raise
529 530
530 @property 531 @property
diff --git a/horizon/middleware/base.py b/horizon/middleware/base.py
index f8a8eee..7ae8f9a 100644
--- a/horizon/middleware/base.py
+++ b/horizon/middleware/base.py
@@ -97,8 +97,8 @@ class HorizonMiddleware(object):
97 'You need to configure file-based or database-backed ' 97 'You need to configure file-based or database-backed '
98 'sessions instead of cookie-based sessions: ' 98 'sessions instead of cookie-based sessions: '
99 'http://docs.openstack.org/developer/horizon/topics/' 99 'http://docs.openstack.org/developer/horizon/topics/'
100 'deployment.html#session-storage' 100 'deployment.html#session-storage',
101 % { 101 {
102 'user_id': request.session.get( 102 'user_id': request.session.get(
103 'user_id', 'Unknown'), 103 'user_id', 'Unknown'),
104 'cookie_size': cookie_size, 104 'cookie_size': cookie_size,
diff --git a/horizon/tables/actions.py b/horizon/tables/actions.py
index 201532f..47e9acd 100644
--- a/horizon/tables/actions.py
+++ b/horizon/tables/actions.py
@@ -405,7 +405,8 @@ class LinkAction(BaseAction):
405 else: 405 else:
406 return urlresolvers.reverse(self.url) 406 return urlresolvers.reverse(self.url)
407 except urlresolvers.NoReverseMatch as ex: 407 except urlresolvers.NoReverseMatch as ex:
408 LOG.info('No reverse found for "%s": %s' % (self.url, ex)) 408 LOG.info('No reverse found for "%(url)s": %(exception)s',
409 {'url': self.url, 'exception': ex})
409 return self.url 410 return self.url
410 411
411 412
@@ -846,8 +847,9 @@ class BatchAction(Action):
846 self.update(request, datum) 847 self.update(request, datum)
847 action_success.append(datum_display) 848 action_success.append(datum_display)
848 self.success_ids.append(datum_id) 849 self.success_ids.append(datum_id)
849 LOG.info(u'%s: "%s"' % 850 LOG.info(u'%(action)s: "%(datum_display)s"',
850 (self._get_action_name(past=True), datum_display)) 851 {'action': self._get_action_name(past=True),
852 'datum_display': datum_display})
851 except Exception as ex: 853 except Exception as ex:
852 # Handle the exception but silence it since we'll display 854 # Handle the exception but silence it since we'll display
853 # an aggregate error message later. Otherwise we'd get 855 # an aggregate error message later. Otherwise we'd get
@@ -972,14 +974,15 @@ class Deprecated(type):
972 # oslo_log.versionutils when it's finally added in 11.0 974 # oslo_log.versionutils when it's finally added in 11.0
973 def __new__(meta, name, bases, kwargs): 975 def __new__(meta, name, bases, kwargs):
974 cls = super(Deprecated, meta).__new__(meta, name, bases, kwargs) 976 cls = super(Deprecated, meta).__new__(meta, name, bases, kwargs)
975 message = ("WARNING:The UpdateAction class defined in module '%s'"
976 " is deprecated as of Newton and may be removed in "
977 "Horizon P (12.0). Class '%s' defined at module '%s' "
978 "shall no longer subclass it.")
979 if name != 'UpdateAction': 977 if name != 'UpdateAction':
980 LOG.warning(message % (UpdateAction.__module__, 978 LOG.warning(
981 name, 979 "WARNING:The UpdateAction class defined in module '%(mod)s' "
982 kwargs['__module__'])) 980 "is deprecated as of Newton and may be removed in "
981 "Horizon P (12.0). Class '%(name)s' defined at "
982 "module '%(module)s' shall no longer subclass it.",
983 {'mod': UpdateAction.__module__,
984 'name': name,
985 'module': kwargs['__module__']})
983 return cls 986 return cls
984 987
985 988
diff --git a/horizon/tables/base.py b/horizon/tables/base.py
index 8f0c9cd..8ac4414 100644
--- a/horizon/tables/base.py
+++ b/horizon/tables/base.py
@@ -1673,8 +1673,8 @@ class DataTable(object):
1673 # If not allowed, neither edit mod or updating is allowed. 1673 # If not allowed, neither edit mod or updating is allowed.
1674 if not cell.update_allowed: 1674 if not cell.update_allowed:
1675 datum_display = (self.get_object_display(datum) or "N/A") 1675 datum_display = (self.get_object_display(datum) or "N/A")
1676 LOG.info('Permission denied to %s: "%s"' % 1676 LOG.info('Permission denied to Update Action: "%s"',
1677 ("Update Action", datum_display)) 1677 datum_display)
1678 return HttpResponse(status=401) 1678 return HttpResponse(status=401)
1679 # If it is post request, we are updating the cell. 1679 # If it is post request, we are updating the cell.
1680 if request.method == "POST": 1680 if request.method == "POST":
diff --git a/horizon/test/helpers.py b/horizon/test/helpers.py
index 82f4c85..b3b0dd4 100644
--- a/horizon/test/helpers.py
+++ b/horizon/test/helpers.py
@@ -52,7 +52,7 @@ try:
52 52
53 from horizon.test.webdriver import WebDriver 53 from horizon.test.webdriver import WebDriver
54except ImportError as e: 54except ImportError as e:
55 LOG.warning("{0}, force WITH_SELENIUM=False".format(str(e))) 55 LOG.warning("%s, force WITH_SELENIUM=False", e)
56 os.environ['WITH_SELENIUM'] = '' 56 os.environ['WITH_SELENIUM'] = ''
57 57
58 58
diff --git a/horizon/utils/file_discovery.py b/horizon/utils/file_discovery.py
index b5784b5..0322703 100644
--- a/horizon/utils/file_discovery.py
+++ b/horizon/utils/file_discovery.py
@@ -108,5 +108,7 @@ def _log(file_list, list_name, in_path):
108 """Logs result at debug level 108 """Logs result at debug level
109 """ 109 """
110 file_names = '\n'.join(file_list) 110 file_names = '\n'.join(file_list)
111 LOG.debug("\nDiscovered {0} {1} file(s) in {2}:\n{3}\n" 111 LOG.debug("\nDiscovered %(size)d %(name)s file(s) in %(path)s:\n"
112 .format(len(file_list), list_name, in_path, file_names)) 112 "%(files)s\n",
113 {'size': len(file_list), 'name': list_name, 'path': in_path,
114 'files': file_names})
diff --git a/openstack_dashboard/api/glance.py b/openstack_dashboard/api/glance.py
index 86d4971..d0f31f8 100644
--- a/openstack_dashboard/api/glance.py
+++ b/openstack_dashboard/api/glance.py
@@ -351,10 +351,9 @@ def image_update(request, image_id, **kwargs):
351 filename = str(image_data.file) 351 filename = str(image_data.file)
352 if hasattr(image_data.file, 'name'): 352 if hasattr(image_data.file, 'name'):
353 filename = image_data.file.name 353 filename = image_data.file.name
354 msg = (('Failed to remove temporary image file ' 354 LOG.warning('Failed to remove temporary image file '
355 '%(file)s (%(e)s)') % 355 '%(file)s (%(e)s)',
356 dict(file=filename, e=str(e))) 356 {'file': filename, 'e': e})
357 LOG.warning(msg)
358 357
359 358
360def get_image_upload_mode(): 359def get_image_upload_mode():
@@ -363,7 +362,7 @@ def get_image_upload_mode():
363 mode = getattr(settings, 'HORIZON_IMAGES_UPLOAD_MODE', 'legacy') 362 mode = getattr(settings, 'HORIZON_IMAGES_UPLOAD_MODE', 'legacy')
364 if mode not in ('off', 'legacy', 'direct'): 363 if mode not in ('off', 'legacy', 'direct'):
365 LOG.warning('HORIZON_IMAGES_UPLOAD_MODE has an unrecognized value of ' 364 LOG.warning('HORIZON_IMAGES_UPLOAD_MODE has an unrecognized value of '
366 '"%s", reverting to default "legacy" value' % mode) 365 '"%s", reverting to default "legacy" value', mode)
367 mode = 'legacy' 366 mode = 'legacy'
368 return mode 367 return mode
369 368
diff --git a/openstack_dashboard/api/keystone.py b/openstack_dashboard/api/keystone.py
index eb80da7..e6ca1d2 100644
--- a/openstack_dashboard/api/keystone.py
+++ b/openstack_dashboard/api/keystone.py
@@ -186,7 +186,7 @@ def keystoneclient(request, admin=False):
186 endpoint = _get_endpoint_url(request, endpoint_type) 186 endpoint = _get_endpoint_url(request, endpoint_type)
187 insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) 187 insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
188 cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None) 188 cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None)
189 LOG.debug("Creating a new keystoneclient connection to %s." % endpoint) 189 LOG.debug("Creating a new keystoneclient connection to %s.", endpoint)
190 remote_addr = request.environ.get('REMOTE_ADDR', '') 190 remote_addr = request.environ.get('REMOTE_ADDR', '')
191 conn = api_version['client'].Client(token=token_id, 191 conn = api_version['client'].Client(token=token_id,
192 endpoint=endpoint, 192 endpoint=endpoint,
@@ -247,7 +247,7 @@ def domain_update(request, domain_id, name=None, description=None,
247 response = manager.update(domain_id, name=name, 247 response = manager.update(domain_id, name=name,
248 description=description, enabled=enabled) 248 description=description, enabled=enabled)
249 except Exception: 249 except Exception:
250 LOG.exception("Unable to update Domain: %s" % domain_id) 250 LOG.exception("Unable to update Domain: %s", domain_id)
251 raise 251 raise
252 return response 252 return response
253 253
@@ -299,11 +299,12 @@ def get_default_domain(request, get_name=True):
299 # we recognize this condition and return the user's 299 # we recognize this condition and return the user's
300 # domain information instead. 300 # domain information instead.
301 LOG.debug("Cannot retrieve domain information for " 301 LOG.debug("Cannot retrieve domain information for "
302 "user (%s) that does not have an admin role " 302 "user (%(user)s) that does not have an admin role "
303 "on project (%s)" % 303 "on project (%(project)s)",
304 (request.user.username, request.user.project_name)) 304 {'user': request.user.username,
305 'project': request.user.project_name})
305 except Exception: 306 except Exception:
306 LOG.warning("Unable to retrieve Domain: %s" % domain_id) 307 LOG.warning("Unable to retrieve Domain: %s", domain_id)
307 domain = base.APIDictWrapper({"id": domain_id, 308 domain = base.APIDictWrapper({"id": domain_id,
308 "name": domain_name}) 309 "name": domain_name})
309 return domain 310 return domain
diff --git a/openstack_dashboard/api/neutron.py b/openstack_dashboard/api/neutron.py
index d13d64e..5c44d23 100644
--- a/openstack_dashboard/api/neutron.py
+++ b/openstack_dashboard/api/neutron.py
@@ -645,8 +645,8 @@ def network_list_for_tenant(request, tenant_id, include_external=False,
645 The list contains networks owned by the tenant and public networks. 645 The list contains networks owned by the tenant and public networks.
646 If requested_networks specified, it searches requested_networks only. 646 If requested_networks specified, it searches requested_networks only.
647 """ 647 """
648 LOG.debug("network_list_for_tenant(): tenant_id=%s, params=%s" 648 LOG.debug("network_list_for_tenant(): tenant_id=%(tenant_id)s, "
649 % (tenant_id, params)) 649 "params=%(params)s", {'tenant_id': tenant_id, 'params': params})
650 650
651 networks = [] 651 networks = []
652 shared = params.get('shared') 652 shared = params.get('shared')
@@ -682,7 +682,8 @@ def network_list_for_tenant(request, tenant_id, include_external=False,
682 682
683@profiler.trace 683@profiler.trace
684def network_get(request, network_id, expand_subnet=True, **params): 684def network_get(request, network_id, expand_subnet=True, **params):
685 LOG.debug("network_get(): netid=%s, params=%s" % (network_id, params)) 685 LOG.debug("network_get(): netid=%(network_id)s, params=%(params)s",
686 {'network_id': network_id, 'params': params})
686 network = neutronclient(request).show_network(network_id, 687 network = neutronclient(request).show_network(network_id,
687 **params).get('network') 688 **params).get('network')
688 if expand_subnet: 689 if expand_subnet:
@@ -704,7 +705,7 @@ def network_create(request, **kwargs):
704 :param name: (optional) name of the network created 705 :param name: (optional) name of the network created
705 :returns: Network object 706 :returns: Network object
706 """ 707 """
707 LOG.debug("network_create(): kwargs = %s" % kwargs) 708 LOG.debug("network_create(): kwargs = %s", kwargs)
708 if 'tenant_id' not in kwargs: 709 if 'tenant_id' not in kwargs:
709 kwargs['tenant_id'] = request.user.project_id 710 kwargs['tenant_id'] = request.user.project_id
710 body = {'network': kwargs} 711 body = {'network': kwargs}
@@ -714,7 +715,8 @@ def network_create(request, **kwargs):
714 715
715@profiler.trace 716@profiler.trace
716def network_update(request, network_id, **kwargs): 717def network_update(request, network_id, **kwargs):
717 LOG.debug("network_update(): netid=%s, params=%s" % (network_id, kwargs)) 718 LOG.debug("network_update(): netid=%(network_id)s, params=%(params)s",
719 {'network_id': network_id, 'params': kwargs})
718 body = {'network': kwargs} 720 body = {'network': kwargs}
719 network = neutronclient(request).update_network(network_id, 721 network = neutronclient(request).update_network(network_id,
720 body=body).get('network') 722 body=body).get('network')
@@ -723,20 +725,21 @@ def network_update(request, network_id, **kwargs):
723 725
724@profiler.trace 726@profiler.trace
725def network_delete(request, network_id): 727def network_delete(request, network_id):
726 LOG.debug("network_delete(): netid=%s" % network_id) 728 LOG.debug("network_delete(): netid=%s", network_id)
727 neutronclient(request).delete_network(network_id) 729 neutronclient(request).delete_network(network_id)
728 730
729 731
730@profiler.trace 732@profiler.trace
731def subnet_list(request, **params): 733def subnet_list(request, **params):
732 LOG.debug("subnet_list(): params=%s" % (params)) 734 LOG.debug("subnet_list(): params=%s", params)
733 subnets = neutronclient(request).list_subnets(**params).get('subnets') 735 subnets = neutronclient(request).list_subnets(**params).get('subnets')
734 return [Subnet(s) for s in subnets] 736 return [Subnet(s) for s in subnets]
735 737
736 738
737@profiler.trace 739@profiler.trace
738def subnet_get(request, subnet_id, **params): 740def subnet_get(request, subnet_id, **params):
739 LOG.debug("subnet_get(): subnetid=%s, params=%s" % (subnet_id, params)) 741 LOG.debug("subnet_get(): subnetid=%(subnet_id)s, params=%(params)s",
742 {'subnet_id': subnet_id, 'params': params})
740 subnet = neutronclient(request).show_subnet(subnet_id, 743 subnet = neutronclient(request).show_subnet(subnet_id,
741 **params).get('subnet') 744 **params).get('subnet')
742 return Subnet(subnet) 745 return Subnet(subnet)
@@ -761,8 +764,8 @@ def subnet_create(request, network_id, **kwargs):
761 optional you MUST pass along one of the combinations to get a successful 764 optional you MUST pass along one of the combinations to get a successful
762 result. 765 result.
763 """ 766 """
764 LOG.debug("subnet_create(): netid=%s, kwargs=%s" 767 LOG.debug("subnet_create(): netid=%(network_id)s, kwargs=%(kwargs)s",
765 % (network_id, kwargs)) 768 {'network_id': network_id, 'kwargs': kwargs})
766 body = {'subnet': {'network_id': network_id}} 769 body = {'subnet': {'network_id': network_id}}
767 if 'tenant_id' not in kwargs: 770 if 'tenant_id' not in kwargs:
768 kwargs['tenant_id'] = request.user.project_id 771 kwargs['tenant_id'] = request.user.project_id
@@ -773,7 +776,8 @@ def subnet_create(request, network_id, **kwargs):
773 776
774@profiler.trace 777@profiler.trace
775def subnet_update(request, subnet_id, **kwargs): 778def subnet_update(request, subnet_id, **kwargs):
776 LOG.debug("subnet_update(): subnetid=%s, kwargs=%s" % (subnet_id, kwargs)) 779 LOG.debug("subnet_update(): subnetid=%(subnet_id)s, kwargs=%(kwargs)s",
780 {'subnet_id': subnet_id, 'kwargs': kwargs})
777 body = {'subnet': kwargs} 781 body = {'subnet': kwargs}
778 subnet = neutronclient(request).update_subnet(subnet_id, 782 subnet = neutronclient(request).update_subnet(subnet_id,
779 body=body).get('subnet') 783 body=body).get('subnet')
@@ -782,13 +786,13 @@ def subnet_update(request, subnet_id, **kwargs):
782 786
783@profiler.trace 787@profiler.trace
784def subnet_delete(request, subnet_id): 788def subnet_delete(request, subnet_id):
785 LOG.debug("subnet_delete(): subnetid=%s" % subnet_id) 789 LOG.debug("subnet_delete(): subnetid=%s", subnet_id)
786 neutronclient(request).delete_subnet(subnet_id) 790 neutronclient(request).delete_subnet(subnet_id)
787 791
788 792
789@profiler.trace 793@profiler.trace
790def subnetpool_list(request, **params): 794def subnetpool_list(request, **params):
791 LOG.debug("subnetpool_list(): params=%s" % (params)) 795 LOG.debug("subnetpool_list(): params=%s", params)
792 subnetpools = \ 796 subnetpools = \
793 neutronclient(request).list_subnetpools(**params).get('subnetpools') 797 neutronclient(request).list_subnetpools(**params).get('subnetpools')
794 return [SubnetPool(s) for s in subnetpools] 798 return [SubnetPool(s) for s in subnetpools]
@@ -796,8 +800,9 @@ def subnetpool_list(request, **params):
796 800
797@profiler.trace 801@profiler.trace
798def subnetpool_get(request, subnetpool_id, **params): 802def subnetpool_get(request, subnetpool_id, **params):
799 LOG.debug("subnetpool_get(): subnetpoolid=%s, params=%s" % 803 LOG.debug("subnetpool_get(): subnetpoolid=%(subnetpool_id)s, "
800 (subnetpool_id, params)) 804 "params=%(params)s", {'subnetpool_id': subnetpool_id,
805 'params': params})
801 subnetpool = \ 806 subnetpool = \
802 neutronclient(request).show_subnetpool(subnetpool_id, 807 neutronclient(request).show_subnetpool(subnetpool_id,
803 **params).get('subnetpool') 808 **params).get('subnetpool')
@@ -826,8 +831,9 @@ def subnetpool_create(request, name, prefixes, **kwargs):
826 Returns: 831 Returns:
827 SubnetPool object 832 SubnetPool object
828 """ 833 """
829 LOG.debug("subnetpool_create(): name=%s, prefixes=%s, kwargs=%s" 834 LOG.debug("subnetpool_create(): name=%(name)s, prefixes=%(prefixes)s, "
830 % (name, prefixes, kwargs)) 835 "kwargs=%(kwargs)s", {'name': name, 'prefixes': prefixes,
836 'kwargs': kwargs})
831 body = {'subnetpool': 837 body = {'subnetpool':
832 {'name': name, 838 {'name': name,
833 'prefixes': prefixes, 839 'prefixes': prefixes,
@@ -843,8 +849,9 @@ def subnetpool_create(request, name, prefixes, **kwargs):
843 849
844@profiler.trace 850@profiler.trace
845def subnetpool_update(request, subnetpool_id, **kwargs): 851def subnetpool_update(request, subnetpool_id, **kwargs):
846 LOG.debug("subnetpool_update(): subnetpoolid=%s, kwargs=%s" % 852 LOG.debug("subnetpool_update(): subnetpoolid=%(subnetpool_id)s, "
847 (subnetpool_id, kwargs)) 853 "kwargs=%(kwargs)s", {'subnetpool_id': subnetpool_id,
854 'kwargs': kwargs})
848 body = {'subnetpool': kwargs} 855 body = {'subnetpool': kwargs}
849 subnetpool = \ 856 subnetpool = \
850 neutronclient(request).update_subnetpool(subnetpool_id, 857 neutronclient(request).update_subnetpool(subnetpool_id,
@@ -854,20 +861,21 @@ def subnetpool_update(request, subnetpool_id, **kwargs):
854 861
855@profiler.trace 862@profiler.trace
856def subnetpool_delete(request, subnetpool_id): 863def subnetpool_delete(request, subnetpool_id):
857 LOG.debug("subnetpool_delete(): subnetpoolid=%s" % subnetpool_id) 864 LOG.debug("subnetpool_delete(): subnetpoolid=%s", subnetpool_id)
858 return neutronclient(request).delete_subnetpool(subnetpool_id) 865 return neutronclient(request).delete_subnetpool(subnetpool_id)
859 866
860 867
861@profiler.trace 868@profiler.trace
862def port_list(request, **params): 869def port_list(request, **params):
863 LOG.debug("port_list(): params=%s" % (params)) 870 LOG.debug("port_list(): params=%s", params)
864 ports = neutronclient(request).list_ports(**params).get('ports') 871 ports = neutronclient(request).list_ports(**params).get('ports')
865 return [Port(p) for p in ports] 872 return [Port(p) for p in ports]
866 873
867 874
868@profiler.trace 875@profiler.trace
869def port_get(request, port_id, **params): 876def port_get(request, port_id, **params):
870 LOG.debug("port_get(): portid=%s, params=%s" % (port_id, params)) 877 LOG.debug("port_get(): portid=%(port_id)s, params=%(params)s",
878 {'port_id': port_id, 'params': params})
871 port = neutronclient(request).show_port(port_id, **params).get('port') 879 port = neutronclient(request).show_port(port_id, **params).get('port')
872 return Port(port) 880 return Port(port)
873 881
@@ -890,7 +898,8 @@ def port_create(request, network_id, **kwargs):
890 :param name: (optional) name of the port created 898 :param name: (optional) name of the port created
891 :returns: Port object 899 :returns: Port object
892 """ 900 """
893 LOG.debug("port_create(): netid=%s, kwargs=%s" % (network_id, kwargs)) 901 LOG.debug("port_create(): netid=%(network_id)s, kwargs=%(kwargs)s",
902 {'network_id': network_id, 'kwargs': kwargs})
894 kwargs = unescape_port_kwargs(**kwargs) 903 kwargs = unescape_port_kwargs(**kwargs)
895 body = {'port': {'network_id': network_id}} 904 body = {'port': {'network_id': network_id}}
896 if 'tenant_id' not in kwargs: 905 if 'tenant_id' not in kwargs:
@@ -902,13 +911,14 @@ def port_create(request, network_id, **kwargs):
902 911
903@profiler.trace 912@profiler.trace
904def port_delete(request, port_id): 913def port_delete(request, port_id):
905 LOG.debug("port_delete(): portid=%s" % port_id) 914 LOG.debug("port_delete(): portid=%s", port_id)
906 neutronclient(request).delete_port(port_id) 915 neutronclient(request).delete_port(port_id)
907 916
908 917
909@profiler.trace 918@profiler.trace
910def port_update(request, port_id, **kwargs): 919def port_update(request, port_id, **kwargs):
911 LOG.debug("port_update(): portid=%s, kwargs=%s" % (port_id, kwargs)) 920 LOG.debug("port_update(): portid=%(port_id)s, kwargs=%(kwargs)s",
921 {'port_id': port_id, 'kwargs': kwargs})
912 kwargs = unescape_port_kwargs(**kwargs) 922 kwargs = unescape_port_kwargs(**kwargs)
913 body = {'port': kwargs} 923 body = {'port': kwargs}
914 port = neutronclient(request).update_port(port_id, body=body).get('port') 924 port = neutronclient(request).update_port(port_id, body=body).get('port')
@@ -917,7 +927,7 @@ def port_update(request, port_id, **kwargs):
917 927
918@profiler.trace 928@profiler.trace
919def router_create(request, **kwargs): 929def router_create(request, **kwargs):
920 LOG.debug("router_create():, kwargs=%s" % kwargs) 930 LOG.debug("router_create():, kwargs=%s", kwargs)
921 body = {'router': {}} 931 body = {'router': {}}
922 if 'tenant_id' not in kwargs: 932 if 'tenant_id' not in kwargs:
923 kwargs['tenant_id'] = request.user.project_id 933 kwargs['tenant_id'] = request.user.project_id
@@ -928,7 +938,8 @@ def router_create(request, **kwargs):
928 938
929@profiler.trace 939@profiler.trace
930def router_update(request, r_id, **kwargs): 940def router_update(request, r_id, **kwargs):
931 LOG.debug("router_update(): router_id=%s, kwargs=%s" % (r_id, kwargs)) 941 LOG.debug("router_update(): router_id=%(r_id)s, kwargs=%(kwargs)s",
942 {'r_id': r_id, 'kwargs': kwargs})
932 body = {'router': {}} 943 body = {'router': {}}
933 body['router'].update(kwargs) 944 body['router'].update(kwargs)
934 router = neutronclient(request).update_router(r_id, body=body) 945 router = neutronclient(request).update_router(r_id, body=body)
diff --git a/openstack_dashboard/api/nova.py b/openstack_dashboard/api/nova.py
index cfc0cd4..3e6b700 100644
--- a/openstack_dashboard/api/nova.py
+++ b/openstack_dashboard/api/nova.py
@@ -339,9 +339,9 @@ class SecurityGroupManager(network_base.SecurityGroupManager):
339 num_groups_to_modify -= 1 339 num_groups_to_modify -= 1
340 except nova_exceptions.ClientException as err: 340 except nova_exceptions.ClientException as err:
341 LOG.error(_("Failed to modify %(num_groups_to_modify)d instance " 341 LOG.error(_("Failed to modify %(num_groups_to_modify)d instance "
342 "security groups: %(err)s") % 342 "security groups: %(err)s"),
343 dict(num_groups_to_modify=num_groups_to_modify, 343 {'num_groups_to_modify': num_groups_to_modify,
344 err=err)) 344 'err': err})
345 # reraise novaclient.exceptions.ClientException, but with 345 # reraise novaclient.exceptions.ClientException, but with
346 # a sanitized error message so we don't risk exposing 346 # a sanitized error message so we don't risk exposing
347 # sensitive information to the end user. This has to be 347 # sensitive information to the end user. This has to be
diff --git a/openstack_dashboard/dashboards/admin/floating_ips/tables.py b/openstack_dashboard/dashboards/admin/floating_ips/tables.py
index e9007d6..9d7c9ce 100644
--- a/openstack_dashboard/dashboards/admin/floating_ips/tables.py
+++ b/openstack_dashboard/dashboards/admin/floating_ips/tables.py
@@ -62,7 +62,7 @@ class AdminSimpleDisassociateIP(project_tables.DisassociateIP):
62 try: 62 try:
63 fip = table.get_object_by_id(filters.get_int_or_uuid(obj_id)) 63 fip = table.get_object_by_id(filters.get_int_or_uuid(obj_id))
64 api.network.floating_ip_disassociate(request, fip.id) 64 api.network.floating_ip_disassociate(request, fip.id)
65 LOG.info('Disassociating Floating IP "%s".' % obj_id) 65 LOG.info('Disassociating Floating IP "%s".', obj_id)
66 messages.success(request, 66 messages.success(request,
67 _('Successfully disassociated Floating IP: %s') 67 _('Successfully disassociated Floating IP: %s')
68 % fip.ip) 68 % fip.ip)
diff --git a/openstack_dashboard/dashboards/admin/images/views.py b/openstack_dashboard/dashboards/admin/images/views.py
index 7bc4dcd..478a0a3 100644
--- a/openstack_dashboard/dashboards/admin/images/views.py
+++ b/openstack_dashboard/dashboards/admin/images/views.py
@@ -120,16 +120,20 @@ class IndexView(tables.DataTableView):
120 if filter_field and filter_string and ( 120 if filter_field and filter_string and (
121 filter_action.is_api_filter(filter_field)): 121 filter_action.is_api_filter(filter_field)):
122 if filter_field in ['size_min', 'size_max']: 122 if filter_field in ['size_min', 'size_max']:
123 invalid_msg = ('API query is not valid and is ignored: %s=%s' 123 invalid_msg = ('API query is not valid and is ignored: '
124 % (filter_field, filter_string)) 124 '%(field)s=%(string)s')
125 try: 125 try:
126 filter_string = long(float(filter_string) * (units.Mi)) 126 filter_string = long(float(filter_string) * (units.Mi))
127 if filter_string >= 0: 127 if filter_string >= 0:
128 filters[filter_field] = filter_string 128 filters[filter_field] = filter_string
129 else: 129 else:
130 LOG.warning(invalid_msg) 130 LOG.warning(invalid_msg,
131 {'field': filter_field,
132 'string': filter_string})
131 except ValueError: 133 except ValueError:
132 LOG.warning(invalid_msg) 134 LOG.warning(invalid_msg,
135 {'field': filter_field,
136 'string': filter_string})
133 elif (filter_field == 'disk_format' and 137 elif (filter_field == 'disk_format' and
134 filter_string.lower() == 'docker'): 138 filter_string.lower() == 'docker'):
135 filters['disk_format'] = 'raw' 139 filters['disk_format'] = 'raw'
diff --git a/openstack_dashboard/dashboards/admin/networks/forms.py b/openstack_dashboard/dashboards/admin/networks/forms.py
index c9d9e61..3eec873 100644
--- a/openstack_dashboard/dashboards/admin/networks/forms.py
+++ b/openstack_dashboard/dashboards/admin/networks/forms.py
@@ -263,8 +263,7 @@ class CreateNetwork(forms.SelfHandlingForm):
263 params['provider:segmentation_id'] = ( 263 params['provider:segmentation_id'] = (
264 data['segmentation_id']) 264 data['segmentation_id'])
265 network = api.neutron.network_create(request, **params) 265 network = api.neutron.network_create(request, **params)
266 msg = _('Network %s was successfully created.') % data['name'] 266 LOG.debug(_('Network %s was successfully created.'), data['name'])
267 LOG.debug(msg)
268 return network 267 return network
269 except Exception: 268 except Exception:
270 redirect = reverse('horizon:admin:networks:index') 269 redirect = reverse('horizon:admin:networks:index')
diff --git a/openstack_dashboard/dashboards/admin/networks/ports/forms.py b/openstack_dashboard/dashboards/admin/networks/ports/forms.py
index c7bf732..e51da10 100644
--- a/openstack_dashboard/dashboards/admin/networks/ports/forms.py
+++ b/openstack_dashboard/dashboards/admin/networks/ports/forms.py
@@ -156,7 +156,7 @@ class UpdatePort(project_forms.UpdatePort):
156 156
157 def handle(self, request, data): 157 def handle(self, request, data):
158 try: 158 try:
159 LOG.debug('params = %s' % data) 159 LOG.debug('params = %s', data)
160 extension_kwargs = {} 160 extension_kwargs = {}
161 data['admin_state'] = (data['admin_state'] == 'True') 161 data['admin_state'] = (data['admin_state'] == 'True')
162 if 'binding__vnic_type' in data: 162 if 'binding__vnic_type' in data:
diff --git a/openstack_dashboard/dashboards/identity/domains/tables.py b/openstack_dashboard/dashboards/identity/domains/tables.py
index f86af98..6afc63b 100644
--- a/openstack_dashboard/dashboards/identity/domains/tables.py
+++ b/openstack_dashboard/dashboards/identity/domains/tables.py
@@ -118,7 +118,7 @@ class DeleteDomainsAction(tables.DeleteAction):
118 messages.error(request, msg) 118 messages.error(request, msg)
119 raise exceptions.ClientException(409, msg) 119 raise exceptions.ClientException(409, msg)
120 else: 120 else:
121 LOG.info('Deleting domain "%s".' % obj_id) 121 LOG.info('Deleting domain "%s".', obj_id)
122 api.keystone.domain_delete(request, obj_id) 122 api.keystone.domain_delete(request, obj_id)
123 123
124 124
@@ -150,7 +150,7 @@ class DisableDomainsAction(tables.BatchAction):
150 def action(self, request, obj_id): 150 def action(self, request, obj_id):
151 domain = self.table.get_object_by_id(obj_id) 151 domain = self.table.get_object_by_id(obj_id)
152 if domain.enabled: 152 if domain.enabled:
153 LOG.info('Disabling domain "%s".' % obj_id) 153 LOG.info('Disabling domain "%s".', obj_id)
154 try: 154 try:
155 api.keystone.domain_update(request, 155 api.keystone.domain_update(request,
156 domain_id=domain.id, 156 domain_id=domain.id,
@@ -190,7 +190,7 @@ class EnableDomainsAction(tables.BatchAction):
190 def action(self, request, obj_id): 190 def action(self, request, obj_id):
191 domain = self.table.get_object_by_id(obj_id) 191 domain = self.table.get_object_by_id(obj_id)
192 if not domain.enabled: 192 if not domain.enabled:
193 LOG.info('Enabling domain "%s".' % obj_id) 193 LOG.info('Enabling domain "%s".', obj_id)
194 try: 194 try:
195 api.keystone.domain_update(request, 195 api.keystone.domain_update(request,
196 domain_id=domain.id, 196 domain_id=domain.id,
diff --git a/openstack_dashboard/dashboards/identity/domains/workflows.py b/openstack_dashboard/dashboards/identity/domains/workflows.py
index d3f3e34..2f68452 100644
--- a/openstack_dashboard/dashboards/identity/domains/workflows.py
+++ b/openstack_dashboard/dashboards/identity/domains/workflows.py
@@ -265,7 +265,7 @@ class CreateDomain(workflows.Workflow):
265 def handle(self, request, data): 265 def handle(self, request, data):
266 # create the domain 266 # create the domain
267 try: 267 try:
268 LOG.info('Creating domain with name "%s"' % data['name']) 268 LOG.info('Creating domain with name "%s"', data['name'])
269 desc = data['description'] 269 desc = data['description']
270 api.keystone.domain_create(request, 270 api.keystone.domain_create(request,
271 name=data['name'], 271 name=data['name'],
@@ -491,7 +491,7 @@ class UpdateDomain(workflows.Workflow):
491 domain_id = data.pop('domain_id') 491 domain_id = data.pop('domain_id')
492 492
493 try: 493 try:
494 LOG.info('Updating domain with name "%s"' % data['name']) 494 LOG.info('Updating domain with name "%s"', data['name'])
495 api.keystone.domain_update(request, 495 api.keystone.domain_update(request,
496 domain_id, 496 domain_id,
497 name=data['name'], 497 name=data['name'],
diff --git a/openstack_dashboard/dashboards/identity/groups/forms.py b/openstack_dashboard/dashboards/identity/groups/forms.py
index 379d83f..342e218 100644
--- a/openstack_dashboard/dashboards/identity/groups/forms.py
+++ b/openstack_dashboard/dashboards/identity/groups/forms.py
@@ -36,7 +36,7 @@ class CreateGroupForm(forms.SelfHandlingForm):
36 36
37 def handle(self, request, data): 37 def handle(self, request, data):
38 try: 38 try:
39 LOG.info('Creating group with name "%s"' % data['name']) 39 LOG.info('Creating group with name "%s"', data['name'])
40 api.keystone.group_create( 40 api.keystone.group_create(
41 request, 41 request,
42 domain_id=identity_utils.get_domain_id_for_operation( 42 domain_id=identity_utils.get_domain_id_for_operation(
diff --git a/openstack_dashboard/dashboards/identity/groups/tables.py b/openstack_dashboard/dashboards/identity/groups/tables.py
index 9797517..86148f0 100644
--- a/openstack_dashboard/dashboards/identity/groups/tables.py
+++ b/openstack_dashboard/dashboards/identity/groups/tables.py
@@ -83,7 +83,7 @@ class DeleteGroupsAction(policy.PolicyTargetMixin, tables.DeleteAction):
83 return api.keystone.keystone_can_edit_group() 83 return api.keystone.keystone_can_edit_group()
84 84
85 def delete(self, request, obj_id): 85 def delete(self, request, obj_id):
86 LOG.info('Deleting group "%s".' % obj_id) 86 LOG.info('Deleting group "%s".', obj_id)
87 api.keystone.group_delete(request, obj_id) 87 api.keystone.group_delete(request, obj_id)
88 88
89 89
@@ -154,8 +154,8 @@ class RemoveMembers(tables.DeleteAction):
154 def action(self, request, obj_id): 154 def action(self, request, obj_id):
155 user_obj = self.table.get_object_by_id(obj_id) 155 user_obj = self.table.get_object_by_id(obj_id)
156 group_id = self.table.kwargs['group_id'] 156 group_id = self.table.kwargs['group_id']
157 LOG.info('Removing user %s from group %s.' % (user_obj.id, 157 LOG.info('Removing user %(user)s from group %(group)s.',
158 group_id)) 158 {'user': user_obj.id, 'group': group_id})
159 api.keystone.remove_group_user(request, 159 api.keystone.remove_group_user(request,
160 group_id=group_id, 160 group_id=group_id,
161 user_id=user_obj.id) 161 user_id=user_obj.id)
@@ -233,8 +233,8 @@ class AddMembers(tables.BatchAction):
233 def action(self, request, obj_id): 233 def action(self, request, obj_id):
234 user_obj = self.table.get_object_by_id(obj_id) 234 user_obj = self.table.get_object_by_id(obj_id)
235 group_id = self.table.kwargs['group_id'] 235 group_id = self.table.kwargs['group_id']
236 LOG.info('Adding user %s to group %s.' % (user_obj.id, 236 LOG.info('Adding user %(user)s to group %(group)s.',
237 group_id)) 237 {'user': user_obj.id, 'group': group_id})
238 api.keystone.add_group_user(request, 238 api.keystone.add_group_user(request,
239 group_id=group_id, 239 group_id=group_id,
240 user_id=user_obj.id) 240 user_id=user_obj.id)
diff --git a/openstack_dashboard/dashboards/identity/projects/workflows.py b/openstack_dashboard/dashboards/identity/projects/workflows.py
index 0150f0d..76eda7b 100644
--- a/openstack_dashboard/dashboards/identity/projects/workflows.py
+++ b/openstack_dashboard/dashboards/identity/projects/workflows.py
@@ -705,7 +705,7 @@ class UpdateProject(CommonQuotaWorkflow):
705 self.failure_message = msg 705 self.failure_message = msg
706 return 706 return
707 except Exception as e: 707 except Exception as e:
708 LOG.debug('Project update failed: %s' % e) 708 LOG.debug('Project update failed: %s', e)
709 exceptions.handle(request, ignore=True) 709 exceptions.handle(request, ignore=True)
710 return 710 return
711 711
diff --git a/openstack_dashboard/dashboards/identity/users/forms.py b/openstack_dashboard/dashboards/identity/users/forms.py
index 74bfa25..e34cfdc 100644
--- a/openstack_dashboard/dashboards/identity/users/forms.py
+++ b/openstack_dashboard/dashboards/identity/users/forms.py
@@ -90,7 +90,7 @@ class BaseUserForm(forms.SelfHandlingForm):
90 self.fields['project'].choices = project_choices 90 self.fields['project'].choices = project_choices
91 91
92 except Exception: 92 except Exception:
93 LOG.debug("User: %s has no projects" % user_id) 93 LOG.debug("User: %s has no projects", user_id)
94 94
95 95
96class AddExtraColumnMixIn(object): 96class AddExtraColumnMixIn(object):
@@ -162,7 +162,7 @@ class CreateUserForm(PasswordMixin, BaseUserForm, AddExtraColumnMixIn):
162 def handle(self, request, data): 162 def handle(self, request, data):
163 domain = api.keystone.get_default_domain(self.request, False) 163 domain = api.keystone.get_default_domain(self.request, False)
164 try: 164 try:
165 LOG.info('Creating user with name "%s"' % data['name']) 165 LOG.info('Creating user with name "%s"', data['name'])
166 desc = data["description"] 166 desc = data["description"]
167 if "email" in data: 167 if "email" in data:
168 data['email'] = data['email'] or None 168 data['email'] = data['email'] or None
diff --git a/openstack_dashboard/dashboards/identity/users/views.py b/openstack_dashboard/dashboards/identity/users/views.py
index 3061668..32ce48b 100644
--- a/openstack_dashboard/dashboards/identity/users/views.py
+++ b/openstack_dashboard/dashboards/identity/users/views.py
@@ -241,9 +241,8 @@ class DetailView(views.HorizonTemplateView):
241 try: 241 try:
242 tenant = api.keystone.tenant_get(self.request, project_id) 242 tenant = api.keystone.tenant_get(self.request, project_id)
243 except Exception as e: 243 except Exception as e:
244 msg = ('Failed to get tenant %(project_id)s: %(reason)s' % 244 LOG.error('Failed to get tenant %(project_id)s: %(reason)s',
245 {'project_id': project_id, 'reason': e}) 245 {'project_id': project_id, 'reason': e})
246 LOG.error(msg)
247 return tenant 246 return tenant
248 247
249 @memoized.memoized_method 248 @memoized.memoized_method
diff --git a/openstack_dashboard/dashboards/project/floating_ips/tables.py b/openstack_dashboard/dashboards/project/floating_ips/tables.py
index 88ab925..21cc953 100644
--- a/openstack_dashboard/dashboards/project/floating_ips/tables.py
+++ b/openstack_dashboard/dashboards/project/floating_ips/tables.py
@@ -145,7 +145,7 @@ class DisassociateIP(tables.Action):
145 try: 145 try:
146 fip = table.get_object_by_id(filters.get_int_or_uuid(obj_id)) 146 fip = table.get_object_by_id(filters.get_int_or_uuid(obj_id))
147 api.network.floating_ip_disassociate(request, fip.id) 147 api.network.floating_ip_disassociate(request, fip.id)
148 LOG.info('Disassociating Floating IP "%s".' % obj_id) 148 LOG.info('Disassociating Floating IP "%s".', obj_id)
149 messages.success(request, 149 messages.success(request,
150 _('Successfully disassociated Floating IP: %s') 150 _('Successfully disassociated Floating IP: %s')
151 % fip.ip) 151 % fip.ip)
diff --git a/openstack_dashboard/dashboards/project/instances/views.py b/openstack_dashboard/dashboards/project/instances/views.py
index e2a4962..bc59c19 100644
--- a/openstack_dashboard/dashboards/project/instances/views.py
+++ b/openstack_dashboard/dashboards/project/instances/views.py
@@ -141,9 +141,9 @@ class IndexView(tables.DataTableView):
141 instance.full_flavor = api.nova.flavor_get( 141 instance.full_flavor = api.nova.flavor_get(
142 self.request, flavor_id) 142 self.request, flavor_id)
143 except Exception: 143 except Exception:
144 msg = ('Unable to retrieve flavor "%s" for instance "%s".' 144 LOG.info('Unable to retrieve flavor "%(flavor)s" for '
145 % (flavor_id, instance.id)) 145 'instance "%(id)s".',
146 LOG.info(msg) 146 {'flavor': flavor_id, 'id': instance.id})
147 147
148 return instances 148 return instances
149 149
diff --git a/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py b/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py
index 931be79..c4e8053 100644
--- a/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py
+++ b/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py
@@ -677,7 +677,7 @@ class CustomizeAction(workflows.Action):
677 if has_upload: 677 if has_upload:
678 upload_file = files[upload_str] 678 upload_file = files[upload_str]
679 log_script_name = upload_file.name 679 log_script_name = upload_file.name
680 LOG.info('got upload %s' % log_script_name) 680 LOG.info('got upload %s', log_script_name)
681 681
682 if upload_file._size > 16 * units.Ki: # 16kb 682 if upload_file._size > 16 * units.Ki: # 16kb
683 msg = _('File exceeds maximum size (16kb)') 683 msg = _('File exceeds maximum size (16kb)')
@@ -975,7 +975,7 @@ def _cleanup_ports_on_failed_vm_launch(request, nics):
975 LOG.debug('Cleaning up stale VM ports.') 975 LOG.debug('Cleaning up stale VM ports.')
976 for nic in nics: 976 for nic in nics:
977 try: 977 try:
978 LOG.debug('Deleting port with id: %s' % nic['port-id']) 978 LOG.debug('Deleting port with id: %s', nic['port-id'])
979 api.neutron.port_delete(request, nic['port-id']) 979 api.neutron.port_delete(request, nic['port-id'])
980 except Exception: 980 except Exception:
981 ports_failing_deletes.append(nic['port-id']) 981 ports_failing_deletes.append(nic['port-id'])
diff --git a/openstack_dashboard/dashboards/project/networks/ports/forms.py b/openstack_dashboard/dashboards/project/networks/ports/forms.py
index e13df1b..2a601c2 100644
--- a/openstack_dashboard/dashboards/project/networks/ports/forms.py
+++ b/openstack_dashboard/dashboards/project/networks/ports/forms.py
@@ -223,7 +223,7 @@ class UpdatePort(forms.SelfHandlingForm):
223 def handle(self, request, data): 223 def handle(self, request, data):
224 data['admin_state'] = (data['admin_state'] == 'True') 224 data['admin_state'] = (data['admin_state'] == 'True')
225 try: 225 try:
226 LOG.debug('params = %s' % data) 226 LOG.debug('params = %s', data)
227 extension_kwargs = {} 227 extension_kwargs = {}
228 if 'binding__vnic_type' in data: 228 if 'binding__vnic_type' in data:
229 extension_kwargs['binding__vnic_type'] = \ 229 extension_kwargs['binding__vnic_type'] = \
diff --git a/openstack_dashboard/dashboards/project/networks/subnets/workflows.py b/openstack_dashboard/dashboards/project/networks/subnets/workflows.py
index c0e8b83..1202dcc 100644
--- a/openstack_dashboard/dashboards/project/networks/subnets/workflows.py
+++ b/openstack_dashboard/dashboards/project/networks/subnets/workflows.py
@@ -188,8 +188,7 @@ class UpdateSubnet(network_workflows.CreateNetwork):
188 self._setup_subnet_parameters(params, data, is_create=False) 188 self._setup_subnet_parameters(params, data, is_create=False)
189 189
190 subnet = api.neutron.subnet_update(request, subnet_id, **params) 190 subnet = api.neutron.subnet_update(request, subnet_id, **params)
191 msg = _('Subnet "%s" was successfully updated.') % data['cidr'] 191 LOG.debug('Subnet "%s" was successfully updated.', data['cidr'])
192 LOG.debug(msg)
193 return subnet 192 return subnet
194 except Exception as e: 193 except Exception as e:
195 msg = (_('Failed to update subnet "%(sub)s": ' 194 msg = (_('Failed to update subnet "%(sub)s": '
diff --git a/openstack_dashboard/dashboards/project/networks/workflows.py b/openstack_dashboard/dashboards/project/networks/workflows.py
index d745429..15a0c3d 100644
--- a/openstack_dashboard/dashboards/project/networks/workflows.py
+++ b/openstack_dashboard/dashboards/project/networks/workflows.py
@@ -467,9 +467,8 @@ class CreateNetwork(workflows.Workflow):
467 'shared': data['shared']} 467 'shared': data['shared']}
468 network = api.neutron.network_create(request, **params) 468 network = api.neutron.network_create(request, **params)
469 self.context['net_id'] = network.id 469 self.context['net_id'] = network.id
470 msg = (_('Network "%s" was successfully created.') % 470 LOG.debug('Network "%s" was successfully created.',
471 network.name_or_id) 471 network.name_or_id)
472 LOG.debug(msg)
473 return network 472 return network
474 except Exception as e: 473 except Exception as e:
475 msg = (_('Failed to create network "%(network)s": %(reason)s') % 474 msg = (_('Failed to create network "%(network)s": %(reason)s') %
@@ -541,8 +540,7 @@ class CreateNetwork(workflows.Workflow):
541 540
542 subnet = api.neutron.subnet_create(request, **params) 541 subnet = api.neutron.subnet_create(request, **params)
543 self.context['subnet_id'] = subnet.id 542 self.context['subnet_id'] = subnet.id
544 msg = _('Subnet "%s" was successfully created.') % data['cidr'] 543 LOG.debug('Subnet "%s" was successfully created.', data['cidr'])
545 LOG.debug(msg)
546 return subnet 544 return subnet
547 except Exception as e: 545 except Exception as e:
548 if network_name: 546 if network_name:
diff --git a/openstack_dashboard/dashboards/project/stacks/forms.py b/openstack_dashboard/dashboards/project/stacks/forms.py
index 42692a1..e8b9702 100644
--- a/openstack_dashboard/dashboards/project/stacks/forms.py
+++ b/openstack_dashboard/dashboards/project/stacks/forms.py
@@ -191,7 +191,7 @@ class TemplateForm(forms.SelfHandlingForm):
191 # Uploaded file handler 191 # Uploaded file handler
192 if has_upload and not url: 192 if has_upload and not url:
193 log_template_name = files[upload_str].name 193 log_template_name = files[upload_str].name
194 LOG.info('got upload %s' % log_template_name) 194 LOG.info('got upload %s', log_template_name)
195 195
196 tpl = files[upload_str].read() 196 tpl = files[upload_str].read()
197 if tpl.startswith('{'): 197 if tpl.startswith('{'):
diff --git a/openstack_dashboard/dashboards/project/stacks/tabs.py b/openstack_dashboard/dashboards/project/stacks/tabs.py
index 6ab4b1a..1e6c92b 100644
--- a/openstack_dashboard/dashboards/project/stacks/tabs.py
+++ b/openstack_dashboard/dashboards/project/stacks/tabs.py
@@ -100,7 +100,7 @@ class StackEventsTab(tabs.Tab):
100 try: 100 try:
101 stack_identifier = '%s/%s' % (stack.stack_name, stack.id) 101 stack_identifier = '%s/%s' % (stack.stack_name, stack.id)
102 events = api.heat.events_list(self.request, stack_identifier) 102 events = api.heat.events_list(self.request, stack_identifier)
103 LOG.debug('got events %s' % events) 103 LOG.debug('got events %s', events)
104 # The stack id is needed to generate the resource URL. 104 # The stack id is needed to generate the resource URL.
105 for event in events: 105 for event in events:
106 event.stack_id = stack.id 106 event.stack_id = stack.id
@@ -131,7 +131,7 @@ class StackResourcesTab(tabs.Tab):
131 try: 131 try:
132 stack_identifier = '%s/%s' % (stack.stack_name, stack.id) 132 stack_identifier = '%s/%s' % (stack.stack_name, stack.id)
133 resources = api.heat.resources_list(self.request, stack_identifier) 133 resources = api.heat.resources_list(self.request, stack_identifier)
134 LOG.debug('got resources %s' % resources) 134 LOG.debug('got resources %s', resources)
135 # The stack id is needed to generate the resource URL. 135 # The stack id is needed to generate the resource URL.
136 for r in resources: 136 for r in resources:
137 r.stack_id = stack.id 137 r.stack_id = stack.id
diff --git a/openstack_dashboard/dashboards/project/vpn/forms.py b/openstack_dashboard/dashboards/project/vpn/forms.py
index 2f4bf76..1ada5d8 100644
--- a/openstack_dashboard/dashboards/project/vpn/forms.py
+++ b/openstack_dashboard/dashboards/project/vpn/forms.py
@@ -57,7 +57,7 @@ class UpdateVPNService(forms.SelfHandlingForm):
57 return vpnservice 57 return vpnservice
58 except Exception as e: 58 except Exception as e:
59 msg = _('Failed to update VPN Service %s') % context['name'] 59 msg = _('Failed to update VPN Service %s') % context['name']
60 LOG.info('%s: %s' % (msg, e)) 60 LOG.info('%(msg)s: %(exception)s', {'msg': msg, 'exception': e})
61 redirect = reverse(self.failure_url) 61 redirect = reverse(self.failure_url)
62 exceptions.handle(request, msg, redirect=redirect) 62 exceptions.handle(request, msg, redirect=redirect)
63 63
@@ -136,7 +136,7 @@ class UpdateIKEPolicy(forms.SelfHandlingForm):
136 return ikepolicy 136 return ikepolicy
137 except Exception as e: 137 except Exception as e:
138 msg = _('Failed to update IKE Policy %s') % context['name'] 138 msg = _('Failed to update IKE Policy %s') % context['name']
139 LOG.info('%s: %s' % (msg, e)) 139 LOG.info('%(msg)s: %(exception)s', {'msg': msg, 'exception': e})
140 redirect = reverse(self.failure_url) 140 redirect = reverse(self.failure_url)
141 exceptions.handle(request, msg, redirect=redirect) 141 exceptions.handle(request, msg, redirect=redirect)
142 142
@@ -214,7 +214,7 @@ class UpdateIPSecPolicy(forms.SelfHandlingForm):
214 return ipsecpolicy 214 return ipsecpolicy
215 except Exception as e: 215 except Exception as e:
216 msg = _('Failed to update IPSec Policy %s') % context['name'] 216 msg = _('Failed to update IPSec Policy %s') % context['name']
217 LOG.info('%s: %s' % (msg, e)) 217 LOG.info('%(msg)s: %(exception)s', {'msg': msg, 'exception': e})
218 redirect = reverse(self.failure_url) 218 redirect = reverse(self.failure_url)
219 exceptions.handle(request, msg, redirect=redirect) 219 exceptions.handle(request, msg, redirect=redirect)
220 220
@@ -324,6 +324,6 @@ class UpdateIPSecSiteConnection(forms.SelfHandlingForm):
324 except Exception as e: 324 except Exception as e:
325 msg = (_('Failed to update IPSec Site Connection %s') 325 msg = (_('Failed to update IPSec Site Connection %s')
326 % context['name']) 326 % context['name'])
327 LOG.info('%s: %s' % (msg, e)) 327 LOG.info('%(msg)s: %(exception)s', {'msg': msg, 'exception': e})
328 redirect = reverse(self.failure_url) 328 redirect = reverse(self.failure_url)
329 exceptions.handle(request, msg, redirect=redirect) 329 exceptions.handle(request, msg, redirect=redirect)
diff --git a/openstack_dashboard/django_pyscss_fix/__init__.py b/openstack_dashboard/django_pyscss_fix/__init__.py
index 9dae4fd..f53f10d 100644
--- a/openstack_dashboard/django_pyscss_fix/__init__.py
+++ b/openstack_dashboard/django_pyscss_fix/__init__.py
@@ -33,4 +33,5 @@ try:
33 if not os.path.exists(scss_asset_root): 33 if not os.path.exists(scss_asset_root):
34 os.makedirs(scss_asset_root) 34 os.makedirs(scss_asset_root)
35except Exception as e: 35except Exception as e:
36 LOG.info("Error precreating path %s, %s" % (scss_asset_root, e)) 36 LOG.info("Error precreating path %(root)s, %(exc)s",
37 {'root': scss_asset_root, 'exc': e})
diff --git a/openstack_dashboard/settings.py b/openstack_dashboard/settings.py
index 71d3af3..3fd2419 100644
--- a/openstack_dashboard/settings.py
+++ b/openstack_dashboard/settings.py
@@ -360,7 +360,7 @@ if os.path.exists(LOCAL_SETTINGS_DIR_PATH):
360 exec(f.read()) 360 exec(f.read())
361 except Exception as e: 361 except Exception as e:
362 logging.exception( 362 logging.exception(
363 "Can not exec settings snippet %s" % filename) 363 "Can not exec settings snippet %s", filename)
364 364
365# The purpose of OPENSTACK_IMAGE_FORMATS is to provide a simple object 365# The purpose of OPENSTACK_IMAGE_FORMATS is to provide a simple object
366# that does not contain the lazy-loaded translations, so the list can 366# that does not contain the lazy-loaded translations, so the list can
diff --git a/openstack_dashboard/theme_settings.py b/openstack_dashboard/theme_settings.py
index f73c07b..ff7cdec 100644
--- a/openstack_dashboard/theme_settings.py
+++ b/openstack_dashboard/theme_settings.py
@@ -77,7 +77,7 @@ def get_available_themes(available_themes, custom_path, default_path,
77 default_theme = available_themes[custom_ndx][0] 77 default_theme = available_themes[custom_ndx][0]
78 logging.warning("Your AVAILABLE_THEMES already contains your " 78 logging.warning("Your AVAILABLE_THEMES already contains your "
79 "CUSTOM_THEME_PATH, therefore using configuration in " 79 "CUSTOM_THEME_PATH, therefore using configuration in "
80 "AVAILABLE_THEMES for %s." % custom_path) 80 "AVAILABLE_THEMES for %s.", custom_path)
81 81
82 elif custom_path is not None: 82 elif custom_path is not None:
83 new_theme_list.append( 83 new_theme_list.append(
diff --git a/openstack_dashboard/utils/settings.py b/openstack_dashboard/utils/settings.py
index 26a054d..2ac65a2 100644
--- a/openstack_dashboard/utils/settings.py
+++ b/openstack_dashboard/utils/settings.py
@@ -29,7 +29,7 @@ def import_submodules(module):
29 submodule = import_module(name) 29 submodule = import_module(name)
30 except ImportError as e: 30 except ImportError as e:
31 # FIXME: Make the errors non-fatal (do we want that?). 31 # FIXME: Make the errors non-fatal (do we want that?).
32 logging.warning("Error importing %s" % name) 32 logging.warning("Error importing %s", name)
33 logging.exception(e) 33 logging.exception(e)
34 else: 34 else:
35 parent, child = name.rsplit('.', 1) 35 parent, child = name.rsplit('.', 1)