[kolla-ansible][kolla] merge_configs module replacing colon to equal

Sharath Ck sharath.madhava at gmail.com
Tue Jun 7 05:09:27 UTC 2022


Hi,

In kolla-ansible, I am using the merge_configs module to merge service
configs files. I want to merge api-paste.ini config with my custom changes,
however while merging if a line consists of one colon, it is getting
replaced with equal sign. merge_configs splits the line by considering
colon as delimiter and treats two parts as key and value. Later which will
be substituted as key = value.

Original
*/v2.1: oscomputeversion_v2*
Merged
*/v2.1= oscomputeversion_v2  *

Below, colon will be 1 and equal will be -1,















*def _split_key_value(self, line):        colon = line.find(':')
equal = line.find('=')        if colon < 0 and equal < 0:            return
self.error_invalid_assignment(line)        if colon < 0 or (equal >= 0 and
equal < colon):            key, value = line[:equal], line[equal + 1:]
  else:            key, value = line[:colon], line[colon + 1:]        value
= value.strip()        if value and value[0] == value[-1] and
value.startswith(("\"", "'")):            value = value[1:-1]        return
key.strip(), [value]*

I want to keep the config as it is and merge only my custom changes. Please
let me know how to achieve this or colon can be escaped somehow.

Regards,
Sharath
Regards,
Sharath
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20220607/a8936be5/attachment-0001.htm>


More information about the openstack-discuss mailing list