Merge pull request #4615 from kinware/versions-report-2

Add test.versions_information(). Fix stray print() call in version.py.
This commit is contained in:
Pedro Algarvio 2013-04-26 06:59:19 -07:00
commit 89884a0c11
2 changed files with 13 additions and 3 deletions

View File

@ -9,6 +9,8 @@ import time
import random
# Import Salt libs
import salt
import salt.version
import salt.loader
@ -69,10 +71,20 @@ def version():
salt '*' test.version
'''
import salt
return salt.__version__
def versions_information():
'''
Returns versions of components used by salt as a dict
CLI Example::
salt '*' test.versions_information
'''
return dict(salt.version.versions_information())
def versions_report():
'''
Returns versions of components used by salt
@ -81,7 +93,6 @@ def versions_report():
salt '*' test.versions_report
'''
import salt.version
return '\n'.join(salt.version.versions_report())

View File

@ -148,7 +148,6 @@ def versions_report():
'''
Yield each library properly formatted for a console clean output.
'''
print dict(versions_information())
libs = list(versions_information())
padding = len(max([lib[0] for lib in libs], key=len)) + 1