mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Add allowed choices to output format.
Since we're using the print function, we can specify the file handler to user and in this case we choose `sys.stderr`
This commit is contained in:
parent
ef75ea068c
commit
e6df8cbe24
1 changed files with 2 additions and 1 deletions
|
@ -36,6 +36,7 @@ def parse():
|
||||||
'-f',
|
'-f',
|
||||||
'--format',
|
'--format',
|
||||||
dest='format',
|
dest='format',
|
||||||
|
choices=('pprint', 'yaml'),
|
||||||
default='pprint')
|
default='pprint')
|
||||||
out = parser.parse_args()
|
out = parser.parse_args()
|
||||||
return out.__dict__
|
return out.__dict__
|
||||||
|
@ -49,7 +50,7 @@ def mod_data(opts, full):
|
||||||
try:
|
try:
|
||||||
finder.load_file(full)
|
finder.load_file(full)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
sys.stderr.write('ImportError - {0}\n'.format(full))
|
print('ImportError - {0}'.format(full), file=sys.stderr)
|
||||||
return ret
|
return ret
|
||||||
for name, mod in finder.modules.items():
|
for name, mod in finder.modules.items():
|
||||||
basemod = name.split('.')[0]
|
basemod = name.split('.')[0]
|
||||||
|
|
Loading…
Add table
Reference in a new issue