leapp-repository/SOURCES/0018-Fix-actor-tracebacks-f...

42 lines
1.7 KiB
Diff

From e4f733297937847522ecf4b306182c2bcb293676 Mon Sep 17 00:00:00 2001
From: Inessa Vasilevskaya <ivasilev@redhat.com>
Date: Wed, 4 May 2022 13:39:41 +0200
Subject: [PATCH 18/39] Fix actor tracebacks for non-default lang
This should fix tracebacks in actors when LANGUAGE
environment variable is set to non utf-8 in test env.
OAMG-6750
---
commands/preupgrade/__init__.py | 1 +
commands/upgrade/__init__.py | 1 +
2 files changed, 2 insertions(+)
diff --git a/commands/preupgrade/__init__.py b/commands/preupgrade/__init__.py
index 92038bb6..46812b36 100644
--- a/commands/preupgrade/__init__.py
+++ b/commands/preupgrade/__init__.py
@@ -62,6 +62,7 @@ def preupgrade(args, breadcrumbs):
logger.info('Executing workflow until phase: %s', until_phase)
# Set the locale, so that the actors parsing command outputs that might be localized will not fail
+ os.environ['LANGUAGE'] = 'en_US.UTF-8'
os.environ['LC_ALL'] = 'en_US.UTF-8'
os.environ['LANG'] = 'en_US.UTF-8'
workflow.run(context=context, until_phase=until_phase, skip_dialogs=True)
diff --git a/commands/upgrade/__init__.py b/commands/upgrade/__init__.py
index c9c2741c..b64e4d77 100644
--- a/commands/upgrade/__init__.py
+++ b/commands/upgrade/__init__.py
@@ -91,6 +91,7 @@ def upgrade(args, breadcrumbs):
workflow.load_answers(answerfile_path, userchoices_path)
# Set the locale, so that the actors parsing command outputs that might be localized will not fail
+ os.environ['LANGUAGE'] = 'en_US.UTF-8'
os.environ['LC_ALL'] = 'en_US.UTF-8'
os.environ['LANG'] = 'en_US.UTF-8'
workflow.run(context=context, skip_phases_until=skip_phases_until, skip_dialogs=True,
--
2.35.3