mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add support to avoid calling refresh_db in opkg.del_repo
Since refresh_db is a costly operation we should have the option of not calling that Signed-off-by: Cristian Hotea <cristian.hotea@ni.com>
This commit is contained in:
parent
b6028b907b
commit
f66d47451b
1 changed files with 3 additions and 2 deletions
|
@ -1154,6 +1154,7 @@ def del_repo(alias, **kwargs): # pylint: disable=unused-argument
|
|||
|
||||
salt '*' pkg.del_repo alias
|
||||
'''
|
||||
refresh = salt.utils.data.is_true(kwargs.get('refresh', True))
|
||||
repos = list_repos()
|
||||
if repos:
|
||||
deleted_from = dict()
|
||||
|
@ -1179,8 +1180,8 @@ def del_repo(alias, **kwargs): # pylint: disable=unused-argument
|
|||
except OSError:
|
||||
pass
|
||||
ret += msg.format(alias, repo_file)
|
||||
# explicit refresh after a repo is deleted
|
||||
refresh_db()
|
||||
if refresh:
|
||||
refresh_db()
|
||||
return ret
|
||||
|
||||
return "Repo {0} doesn't exist in the opkg repo lists".format(alias)
|
||||
|
|
Loading…
Add table
Reference in a new issue