avoid shadowing outer funcs in modules.lxc.list_()

************* Module salt.modules.lxc
salt/modules/lxc.py:294: [W0621(redefined-outer-name), list_] Redefining name 'info' from outer scope (line 468)
salt/modules/lxc.py:297: [W0621(redefined-outer-name), list_] Redefining name 'state' from outer scope (line 409
This commit is contained in:
Chris Rebert 2014-02-12 10:46:32 -08:00
parent 19610afac0
commit c820bdbeed

View File

@ -291,21 +291,21 @@ def list_():
for container in ctnrs: for container in ctnrs:
c_infos = __salt__['cmd.run']('lxc-info -n {0}'.format(container)) c_infos = __salt__['cmd.run']('lxc-info -n {0}'.format(container))
for info in c_infos: for c_info in c_infos:
stat = info.split(':') stat = c_info.split(':')
if stat[0] == 'state': if stat[0] == 'state':
state = stat[1].strip() c_state = stat[1].strip()
break break
if not len(state): if not len(c_state):
continue continue
if state == 'STOPPED': if c_state == 'STOPPED':
stopped.append(container) stopped.append(container)
continue continue
if state == 'FROZEN': if c_state == 'FROZEN':
frozen.append(container) frozen.append(container)
continue continue
if state == 'RUNNING': if c_state == 'RUNNING':
running.append(container) running.append(container)
continue continue