Merge pull request #7955 from hulu/chocolatey-fixes

chocolatey module fixes
This commit is contained in:
Thomas S Hatch 2013-10-18 12:31:33 -07:00
commit d5a73ed587

View File

@ -17,6 +17,10 @@ from salt.exceptions import CommandExecutionError, CommandNotFoundError
log = logging.getLogger(__name__)
__func_alias__ = {
'list_': 'list'
}
def __virtual__():
'''
@ -135,7 +139,7 @@ def bootstrap(force=False):
return result['stdout']
def list(filter, all_versions=False, pre_versions=False, source=None):
def list_(filter, all_versions=False, pre_versions=False, source=None):
'''
Instructs Chocolatey to pull a vague package list from the repository.
@ -641,13 +645,13 @@ def version(name, check_remote=False, source=None, pre_versions=False):
# printing two value pairs is shown in columns, whereas printing six
# pairs is shown in rows...
if not salt.utils.is_true(check_remote):
ver_re = re.compile('(\S+)\s+(.+)')
ver_re = re.compile(r'(\S+)\s+(.+)')
for line in result['stdout'].split('\n'):
for name, ver in ver_re.findall(line):
ret['name'] = name
ret['found'] = ver
else:
ver_re = re.compile('(\S+)\s+:\s*(.*)')
ver_re = re.compile(r'(\S+)\s+:\s*(.*)')
for line in result['stdout'].split('\n'):
for key, value in ver_re.findall(line):
ret[key] = value