From 187b3bb13070d2c57c1cd28edc451636c78024c6 Mon Sep 17 00:00:00 2001 From: smallfish Date: Thu, 5 Jun 2014 16:42:59 +0800 Subject: [PATCH] Update salt/modules/yumpkg.py, yum install support branch parameter --- salt/modules/yumpkg.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index 172021f3cf..bf936ac5f1 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -130,7 +130,7 @@ def _get_repo_options(**kwargs): repo_arg = '' if fromrepo: log.info('Restricting to repo {0!r}'.format(fromrepo)) - repo_arg = ('--disablerepo={0!r} --enablerepo={1!r}' + repo_arg = ('--disablerepo={0!r} --enablerepo={1!r} ' .format('*', fromrepo)) else: repo_arg = '' @@ -726,6 +726,10 @@ def install(name=None, Disable exclude from main, for a repo or for everything. (e.g., ``yum --disableexcludes='main'``) + branch + Specifies the branch on YUM server. + (e.g., ``yum --branch='test'``) + .. versionadded:: Helium @@ -785,6 +789,10 @@ def install(name=None, 'package targets') repo_arg = _get_repo_options(fromrepo=fromrepo, **kwargs) + # Support branch parameter for yum + branch = kwargs.get('branch', '') + if branch: + repo_arg += '--branch={0!r}'.format(branch) exclude_arg = _get_excludes_option(**kwargs) old = list_pkgs()