summaryrefslogtreecommitdiffstats
path: root/cli/utils.py
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-08-21 13:08:53 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-08-21 13:08:53 +0200
commitfaebdd5a0daa5fa3dd4b75ac1b341e79d26c83d8 (patch)
treed096fee92614ab5cba729b378b65747cb11ee869 /cli/utils.py
parent5226226ab2f46acef4d80130ee3546e7be21b7a6 (diff)
cli: remove accents in image namev0.3.3-10
Remove accents in the --name argument of the create image command.
Diffstat (limited to 'cli/utils.py')
-rw-r--r--cli/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cli/utils.py b/cli/utils.py
index 9831d4b..3825583 100644
--- a/cli/utils.py
+++ b/cli/utils.py
@@ -5,6 +5,7 @@
# Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
+import unicodedata
import json
import ipaddress
import re
@@ -65,3 +66,6 @@ def check_mac_address(addr):
print(addr.lower())
return False
+def remove_accents(text):
+ normalized_text = unicodedata.normalize('NFD', text)
+ return ''.join(c for c in normalized_text if unicodedata.category(c) != 'Mn')