mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #7955 from hulu/chocolatey-fixes
chocolatey module fixes
This commit is contained in:
commit
d5a73ed587
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user