morpheus-cli 8.0.0 → 8.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,7 +29,7 @@ module Morpheus::Cli::ExecutionRequestHelper
29
29
  # unless options[:quiet]
30
30
  # print cyan, "Execution request has not yet finished. Refreshing every #{refresh_display_seconds} seconds...", "\n", reset
31
31
  # end
32
- while execution_request['status'] == 'pending' || execution_request['status'] == 'new' do
32
+ while (options[:waiting_status] || ['new', 'pending']).include?(execution_request['status']) do
33
33
  sleep(refresh_interval)
34
34
  execution_request = execution_request_interface.get(execution_request_id)['executionRequest']
35
35
  end
@@ -509,13 +509,15 @@ module Morpheus::Cli::PrintHelper
509
509
  bars = []
510
510
  percent = 0
511
511
  percent_sigdig = opts[:percent_sigdig] || 2
512
- if max_value.to_i == 0
512
+ if max_value.nil?
513
513
  percent = 0
514
+ elsif max_value == 0
515
+ percent = used_value.to_f == 0 ? 0 : 100
514
516
  else
515
517
  percent = ((used_value.to_f / max_value.to_f) * 100)
516
518
  end
517
519
  unlimited_label = opts[:unlimited_label] || "n/a"
518
- percent_label = ((used_value.nil? || max_value.to_f == 0.0) ? unlimited_label : "#{percent.round(percent_sigdig)}%").rjust(6, ' ')
520
+ percent_label = (max_value.nil? ? unlimited_label : "#{percent.round(percent_sigdig)}%").rjust(6, ' ')
519
521
  bar_display = ""
520
522
  if percent > 100
521
523
  max_bars.times { bars << "|" }