LibVirtKvm-scripts icon indicating copy to clipboard operation
LibVirtKvm-scripts copied to clipboard

Consolidation function don't work in spanish language

Open miguelcarretas opened this issue 1 year ago • 2 comments
trafficstars

Please, add "ejecutando" on if statement:

function consolidate_domain() {
   local domain_name=$1

   local _ret=
   local backing_file=
   local command_output=
   local parent_backing_file=

   local dom_state=
   dom_state=$($VIRSH domstate "$domain_name" 2>&1)
   if **[ "$dom_state" != "running" ] && [ "$dom_state" != "ejecutando" ];** then
      print_v e "Error: Consolidation requires '$domain_name' to be running"
      return 1
   fi

miguelcarretas avatar Nov 06 '24 15:11 miguelcarretas

I think this will always return false. Can you try this instead?

   if  [ "$dom_state" == "running" ] || [ "$dom_state" == "ejecutando" ]; then
       print_v d "Debug: '$domain_name' is running (ejecutando)"
  else
      print_v e "Error: Consolidation requires '$domain_name' to be running"
      return 1
   fi

AJRepo avatar Nov 06 '24 20:11 AJRepo

I think that the best course of action would be to set the language. For instance:

# Fail if one process fails in a pipe
set -o pipefail

# Set the language for all invoked commands
export LC_ALL="en_US.UTF-8" 

@miguelcarretas can you try to do that?

dguerri avatar Nov 06 '24 20:11 dguerri