summaryrefslogtreecommitdiff
path: root/ironic/common/service.py
diff options
context:
space:
mode:
authorGary Kotton <gkotton@vmware.com>2016-06-19 00:18:13 -0700
committerGary Kotton <gkotton@vmware.com>2016-06-19 10:27:48 -0700
commitbc895486babf221444d0f36c935fb11f7a3eaec8 (patch)
treeebe03eb8d73084a9fc289699039ca206e9e5155b /ironic/common/service.py
parent5c659ed3080412ed929c5821375593c375df6db8 (diff)
downloadironic-bc895486babf221444d0f36c935fb11f7a3eaec8.tar.gz
Removes the use of mutables as default args
Passing mutable objects as default args is a known Python pitfall. We'd better avoid this. This commit changes mutable default args with None, 'arg = [] if arg is None else arg'. TrivialFix Change-Id: I2909b111266c696bcdcd26db167d3ad5e0603e45
Diffstat (limited to 'ironic/common/service.py')
-rw-r--r--ironic/common/service.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ironic/common/service.py b/ironic/common/service.py
index 18fabccc7..fa79f8cbd 100644
--- a/ironic/common/service.py
+++ b/ironic/common/service.py
@@ -116,7 +116,8 @@ class RPCService(service.Service):
signal.signal(signal.SIGUSR1, self._handle_signal)
-def prepare_service(argv=[]):
+def prepare_service(argv=None):
+ argv = [] if argv is None else argv
log.register_options(CONF)
log.set_defaults(default_log_levels=['amqp=WARNING',
'amqplib=WARNING',