[tools] testbot/BackupVM: Fix support for non-English locales.

Francois Gouget fgouget at codeweavers.com
Mon Aug 30 11:50:16 CDT 2021


Run virsh in a known locale when we need to parse its output.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
These are translated in virsh 7.0.0 (Debian 11).
---
 testbot/scripts/BackupVM  | 2 +-
 testbot/scripts/RestoreVM | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/testbot/scripts/BackupVM b/testbot/scripts/BackupVM
index 124e222d8..d43388217 100755
--- a/testbot/scripts/BackupVM
+++ b/testbot/scripts/BackupVM
@@ -263,7 +263,7 @@ wait_for_vm()
 
     while true
     do
-        _state=`(virsh --connect "$opt_connect" list --all 2>/dev/null || echo " $_vm error") | sed -e "s/^.* $_vm  *//" -e t -e d`
+        _state=`(LANG= virsh --connect "$opt_connect" list --all 2>/dev/null || echo " $_vm error") | sed -e "s/^.* $_vm  *//" -e t -e d`
         [ -z "$opt_dry_run" ] || _state="shut off"
         case "$_state" in
         "error")
diff --git a/testbot/scripts/RestoreVM b/testbot/scripts/RestoreVM
index a1b9d1584..29f5f43d6 100755
--- a/testbot/scripts/RestoreVM
+++ b/testbot/scripts/RestoreVM
@@ -522,7 +522,7 @@ wait_for_vm()
 
     while true
     do
-        _state=`(virsh --connect "$opt_connect" list --all 2>/dev/null || echo " $_vm error") | sed -e "s/^.* $_vm  *//" -e t -e d`
+        _state=`(LANG= virsh --connect "$opt_connect" list --all 2>/dev/null || echo " $_vm error") | sed -e "s/^.* $_vm  *//" -e t -e d`
         [ -z "$opt_dry_run" ] || _state="shut off"
         case "$_state" in
         "error")
-- 
2.30.2



More information about the wine-devel mailing list