Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidation function don't work in spanish language #51

Open
miguelcarretas opened this issue Nov 6, 2024 · 2 comments
Open

Consolidation function don't work in spanish language #51

miguelcarretas opened this issue Nov 6, 2024 · 2 comments

Comments

@miguelcarretas
Copy link

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 miguelcarretas changed the title Consolodition function don't work in spanish language Consolidation function don't work in spanish language Nov 6, 2024
@AJRepo
Copy link
Collaborator

AJRepo commented Nov 6, 2024

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

@dguerri
Copy link
Owner

dguerri commented Nov 6, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants