Fix variable definition in wrong scope

File "/usr/lib/python2.7/dist-packages/salt/states/pkg.py", line 702
UnboundLocalError: local variable 'modified_hold' referenced before assignment
This commit is contained in:
Nicolas Delaby 2014-04-15 15:14:51 +02:00
parent 4ee7dc8a44
commit 19e7264d3c

View File

@ -620,6 +620,9 @@ def installed(
'comment': ' '.join(comment)}
changes = {'installed': {}}
modified_hold = None
not_modified_hold = None
failed_hold = None
if targets:
try:
pkg_ret = __salt__['pkg.install'](name,
@ -640,9 +643,6 @@ def installed(
'comment': 'An error was encountered while installing '
'package(s): {0}'.format(exc)}
modified_hold = None
not_modified_hold = None
failed_hold = None
if 'pkg.hold' in __salt__:
if 'hold' in kwargs:
if kwargs['hold']: