Closed davidski closed 9 years ago
ConfigParser supports multiline but leading and trailing whitespace are removed from keys and values. This means using entry below will work:
custom_json= {
"vulnpryer" : {
"config" : {
"vulndb" : {
"environment" : "staging",
"consumer_key" : "<consumer key>",
"consumer_secret" : "<consumer secret>"
},
"s3" : {
"bucket_name" : "<bucket name>",
"key" : "<key>"
},
"redseal" : {
"username" : "<username>",
"password" : "<password>"
}
},
"ebs" :{
"volume_id" : "vol-45010e0d"
}
}
}
but if you check them in the UI, you will be shown with this:
{
"vulnpryer" : {
"config" : {
"vulndb" : {
"environment" : "staging",
"consumer_key" : "<consumer key>",
"consumer_secret" : "<consumer secret>"
},
"s3" : {
"bucket_name" : "<bucket name>",
"key" : "<key>"
},
"redseal" : {
"username" : "<username>",
"password" : "<password>"
}
},
"ebs" :{
"volume_id" : "vol-45010e0d"
}
}
}
Great! Looks like I just needed to ensure my last line was indented from the first and configparser picked it right up. That makes things a lot more readable. :)
For the custom_json clause, what is the proper syntax to quote multi-line strings? I want the JSON created for this stack to have the formatting (new lines and space indents) to make this structure readable. Attempts to use the following formats have failed:
custom_json="""foo"""
custom_json=r"""foo"""
custom_json='r"""foo"""'