mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Bugfix: crash if no package specified on adding a lock
This commit is contained in:
parent
29806a1af9
commit
36281f6b06
@ -928,7 +928,7 @@ def remove_lock(packages, **kwargs): # pylint: disable=unused-argument
|
|||||||
return {'removed': len(removed), 'not_found': missing}
|
return {'removed': len(removed), 'not_found': missing}
|
||||||
|
|
||||||
|
|
||||||
def add_lock(name=None, pkgs=None, **kwargs): # pylint: disable=unused-argument
|
def add_lock(packages, **kwargs): # pylint: disable=unused-argument
|
||||||
'''
|
'''
|
||||||
Add a package lock. Specify packages to lock by exact name.
|
Add a package lock. Specify packages to lock by exact name.
|
||||||
|
|
||||||
@ -941,10 +941,9 @@ def add_lock(name=None, pkgs=None, **kwargs): # pylint: disable=unused-argument
|
|||||||
salt '*' pkg.add_lock pkgs='["foo", "bar"]'
|
salt '*' pkg.add_lock pkgs='["foo", "bar"]'
|
||||||
'''
|
'''
|
||||||
locks = list_locks()
|
locks = list_locks()
|
||||||
packages = []
|
|
||||||
added = []
|
added = []
|
||||||
try:
|
try:
|
||||||
packages = list(__salt__['pkg_resource.parse_targets'](name, pkgs)[0].keys())
|
packages = list(__salt__['pkg_resource.parse_targets'](packages)[0].keys())
|
||||||
except MinionError as exc:
|
except MinionError as exc:
|
||||||
raise CommandExecutionError(exc)
|
raise CommandExecutionError(exc)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user