[25230] Change LXC version to come from lxc-info

Fix for:
https://github.com/saltstack/salt/issues/25230

Seems lxc-ls isn't reliable to get a version, it 'may' return a version if there is already a container created, but from a blank state there's nothing coming back.
This commit is contained in:
Paul Sellars 2015-07-08 11:02:39 +01:00
parent 49b249e9b6
commit 6dbaab32f9

View File

@ -117,7 +117,7 @@ def version():
''' '''
k = 'lxc.version' k = 'lxc.version'
if not __context__.get(k, None): if not __context__.get(k, None):
cversion = __salt__['cmd.run_all']('lxc-ls --version') cversion = __salt__['cmd.run_all']('lxc-info --version')
if not cversion['retcode']: if not cversion['retcode']:
ver = distutils.version.LooseVersion(cversion['stdout']) ver = distutils.version.LooseVersion(cversion['stdout'])
if ver < distutils.version.LooseVersion('1.0'): if ver < distutils.version.LooseVersion('1.0'):