[elbe-devel] [PATCH 6/7] Add 'plain' encoding for finetuning 'add <file>'

dion at linutronix.de dion at linutronix.de
Fri May 17 11:17:00 CEST 2019


From: Olivier Dion <dion at linutronix.de>

Even though the default encoding is plain text, we should put the
option 'encoding="plain"' if the user wants to be more explicit.

Signed-off-by: Olivier Dion <dion at linutronix.de>
---
 elbepack/finetuning.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
index 7f6c4a6b..4a92c024 100644
--- a/elbepack/finetuning.py
+++ b/elbepack/finetuning.py
@@ -355,10 +355,13 @@ class AddFileAction(FinetuningAction):
 
     @staticmethod
     def decode(text, encoding):
-        if encoding == "base64":
-            return base64.standard_b64decode(text)
+        if encoding == "plain":
+            msg = text
+        elif encoding == "base64":
+            msg = base64.standard_b64decode(text)
         else:
             raise FinetuningException("Invalid encoding %s" % encoding)
+        return msg
 
     def execute(self, log, _buildenv, target):
 
-- 
2.21.0




More information about the elbe-devel mailing list