From ef4a9f9a93211a376e3e0162d9c897bd955c71d6 Mon Sep 17 00:00:00 2001 From: 0xf10e Date: Sat, 15 Aug 2015 18:08:11 +0200 Subject: [PATCH] don't load freebsdpkg when providers:pkg == 'pkgng' --- salt/modules/freebsdpkg.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/salt/modules/freebsdpkg.py b/salt/modules/freebsdpkg.py index 090b1d1f97..eb7f702edc 100644 --- a/salt/modules/freebsdpkg.py +++ b/salt/modules/freebsdpkg.py @@ -86,9 +86,18 @@ __virtualname__ = 'pkg' def __virtual__(): ''' - Load as 'pkg' on FreeBSD versions less than 10 + Load as 'pkg' on FreeBSD versions less than 10. + Don't load on FreeBSD 9 when the config option + ``providers:pkg`` is set to 'pkgng'. ''' if __grains__['os'] == 'FreeBSD' and float(__grains__['osrelease']) < 10: + providers = {} + if 'providers' in __opts__: + providers = __opts__['providers'] + if providers and 'pkg' in providers and providers['pkg'] == 'pkgng': + log.debug('Configuration option \'providers:pkg\' is set to '\ + '\'pkgng\', won\'t load old provider \'freebsdpkg\'.') + return False return __virtualname__ return False