From 9cee41def4bbaddc089ea02f85b2ed028ac5a549 Mon Sep 17 00:00:00 2001 From: Aron Podrigal Date: Thu, 14 Apr 2016 00:21:08 -0400 Subject: [PATCH] Fixed python-lxc reference to var before assignment ``` >>> c = lxc.Container('ct') >>> c.create('debian', args=('-r', 'jessie')) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3/dist-packages/lxc/__init__.py", line 229, in create template_args['args'] = tuple(tmp_args) UnboundLocalError: local variable 'tmp_args' referenced before assignment ``` Signed-off-by: Aron Podrigal --- src/python-lxc/lxc/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/python-lxc/lxc/__init__.py b/src/python-lxc/lxc/__init__.py index 30ebd1bd2..de0210284 100644 --- a/src/python-lxc/lxc/__init__.py +++ b/src/python-lxc/lxc/__init__.py @@ -222,11 +222,12 @@ class Container(_lxc.Container): for item in args.items(): tmp_args.append("--%s" % item[0]) tmp_args.append("%s" % item[1]) + args = tmp_args template_args = {} if template: template_args['template'] = template template_args['flags'] = flags - template_args['args'] = tuple(tmp_args) + template_args['args'] = tuple(args) if bdevtype: template_args['bdevtype'] = bdevtype return _lxc.Container.create(self, **template_args) -- 2.47.2