Commit 391d4570 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent dfe79c77
......@@ -24,6 +24,17 @@
# encode converts string s into form suitable to be used in names of buildout sections.
#
# Such encoding is needed because buildout forbids to use spaces and many other
# characters in section names, which, in turn, leads to inability to use
# arbitrary strings for sections generated based on e.g. instance references
# retrieved from SlapOS Master.
#
# With encoding it becomes possible to use arbitrary names for references
# without leading to instantiation failures like
#
# zc.buildout.configparser.ParsingError: File contains parsing errors: .../instance-enb.cfg
# [line 45]: '[promise-testing partition 0.RU-sdr-busy]\n'
#
# The encoding never fails, does not loose information and can be reversed back via decode.
def encode(s: str): # -> str
s = s.encode('utf-8')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment