Merge pull request #28895 from rallytime/bp-28823

Back-port #28823 to 2015.8
This commit is contained in:
Justin Findlay 2015-11-14 17:43:07 -07:00
commit 64dc3c23e0

View file

@ -32,6 +32,7 @@ HAS_ZYPP = False
ZYPP_HOME = '/etc/zypp'
LOCKS = '{0}/locks'.format(ZYPP_HOME)
REPOS = '{0}/repos.d'.format(ZYPP_HOME)
DEFAULT_PRIORITY = 99
# Define the module's virtual name
__virtualname__ = 'pkg'
@ -502,6 +503,12 @@ def mod_repo(repo, **kwargs):
if kwargs.get('gpgautoimport') is True:
cmd_opt.append('--gpg-auto-import-keys')
if 'priority' in kwargs:
cmd_opt.append("--priority='{0}'".format(kwargs.get('priority', DEFAULT_PRIORITY)))
if 'humanname' in kwargs:
cmd_opt.append("--name='{0}'".format(kwargs.get('humanname')))
if cmd_opt:
__salt__['cmd.run'](('zypper -x mr {0} \'{1}\''.format(' '.join(cmd_opt), repo)),
output_loglevel='trace')