Hello everyone ^^
I have various macro definition in some .conf files such as this example :
BROKER_URI=uri # URI of the MQTT broker
BROKER_PORT=8883 # Port of the broker
BROKER_USERNAME=username # username to authentificate to the broker
BROKER_PASSWORD=password # password to authentificate to the broker
X509 broker certificate
BROKER_X509_CERTIFICATE=-----BEGIN CERTIFICATE-----\nLine1\nLine2\n…-----END CERTIFICATE-----\n
I used a python script, which basically parse the file, searching for each line with a equal symbol, and creating a dictionnary which here would result in :
{‘BROKER_URI’=“uri”, “BROKER_PORT”=8883, …, BROKER_X509_CERTIFICATE=“-----BEGIN CERTIFICATE-----\nLine1\nLine2\n…-----END CERTIFICATE-----\n”}
Line feed special chars are indeed the special chars, and not '' ‘n’ seperated by the parsing method.
When adding all macros to env, no problem, until there’s a new line feed.
In this case, BROKER_X509_CERTIFICATE will end up parsed as “-----BEGIN CERTIFICATE-----/nLine1/nLine2/n…-----END CERTIFICATE-----/n”, with line feed interpreted as ‘/n’.
Would you have any clue on how to solve this please? X509 certificate do need those line feed chars. I suspect the Append to be in cause here, because, when printing beforehand the result of the StringifyMacro, I get the following string
‘"-----BEGIN CERTIFICATE-----\nLine1\nLine2\n…-----END CERTIFICATE-----\n"’