mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Merge pull request #25714 from cachedout/issue_25435
Display warning when progressbar can't be loaded
This commit is contained in:
commit
ad8456eeed
@ -179,7 +179,10 @@ class SaltCMD(parsers.SaltCMDOptionParser):
|
||||
ret = {}
|
||||
for progress in cmd_func(**kwargs):
|
||||
out = 'progress'
|
||||
self._progress_ret(progress, out)
|
||||
try:
|
||||
self._progress_ret(progress, out)
|
||||
except salt.exceptions.LoaderError as exc:
|
||||
raise salt.exceptions.SaltSystemExit(exc)
|
||||
if 'return_count' not in progress:
|
||||
ret.update(progress)
|
||||
self._progress_end(out)
|
||||
@ -272,7 +275,11 @@ class SaltCMD(parsers.SaltCMDOptionParser):
|
||||
import salt.output
|
||||
# Get the progress bar
|
||||
if not hasattr(self, 'progress_bar'):
|
||||
self.progress_bar = salt.output.get_progress(self.config, out, progress)
|
||||
try:
|
||||
self.progress_bar = salt.output.get_progress(self.config, out, progress)
|
||||
except Exception as exc:
|
||||
raise salt.exceptions.LoaderError('\nWARNING: Install the `progressbar` python package. '
|
||||
'Requested job was still run but output cannot be displayed.\n')
|
||||
salt.output.update_progress(self.config, progress, self.progress_bar, out)
|
||||
|
||||
def _output_ret(self, ret, out):
|
||||
|
@ -1485,7 +1485,7 @@ class SaltCMDOptionParser(OptionParser, ConfigDirMixIn, MergeConfigMixIn,
|
||||
'-p', '--progress',
|
||||
default=False,
|
||||
action='store_true',
|
||||
help=('Display a progress graph')
|
||||
help=('Display a progress graph. [Requires `progressbar` python package.]')
|
||||
)
|
||||
self.add_option(
|
||||
'--failhard',
|
||||
|
Loading…
Reference in New Issue
Block a user