Commit 9cee41de by Aron Podrigal

Fixed python-lxc reference to var before assignment

``` >>> c = lxc.Container('ct') >>> c.create('debian', args=('-r', 'jessie')) Traceback (most recent call last): File "<stdin>", line 1, in <module> 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: 's avatarAron Podrigal <aronp@guaranteedplus.com>
parent 81574036
...@@ -222,11 +222,12 @@ class Container(_lxc.Container): ...@@ -222,11 +222,12 @@ class Container(_lxc.Container):
for item in args.items(): for item in args.items():
tmp_args.append("--%s" % item[0]) tmp_args.append("--%s" % item[0])
tmp_args.append("%s" % item[1]) tmp_args.append("%s" % item[1])
args = tmp_args
template_args = {} template_args = {}
if template: if template:
template_args['template'] = template template_args['template'] = template
template_args['flags'] = flags template_args['flags'] = flags
template_args['args'] = tuple(tmp_args) template_args['args'] = tuple(args)
if bdevtype: if bdevtype:
template_args['bdevtype'] = bdevtype template_args['bdevtype'] = bdevtype
return _lxc.Container.create(self, **template_args) return _lxc.Container.create(self, **template_args)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment