Description of problem: I'd like to be able to convert corosync.conf to a better format (preferably XML) for QA purposes. The reasoning behind this request is that I'm currently implementing a clufter testing framework based on XML XPath assert expressions (which works fine for cib.xml files), so it would be nice to have corosync.conf in the same format in order to make writing validation rules easier/unified. Version-Release number of selected component (if applicable): git next branch, commit f5fa0f8fccacb1bdc76ec792df34f9bf373f8229
This is tentatively planned, there is even an to-be implemented method: https://github.com/jnpkrn/clufter/blob/v0.10.3/formats/simpleconfig.py#L119 It is very likely to be needed also for cib+corosync.conf -> pcs commands conversion (applying XSLT here, too, for convenience). Note that pcs already got some kind of corosync.conf to object tree parser: https://github.com/feist/pcs/blob/master/pcs/corosync_conf.py https://github.com/feist/pcs/blob/master/pcs/test/test_corosync_conf.py
Please note that this direction cannot be 1:1 (lack of bijection), e.g.: https://github.com/jnpkrn/clufter/blob/v0.10.3/filters/xml2simpleconfig.py#L16 A possible workaround for that very issue is to add artificial suffixes, likely numbered: <attribute><sep><number>, <sep> being, e.g., "::". (there can be more issues)
Re [comment 1]: > It is very likely to be needed also for cib+corosync.conf -> pcs commands > conversion (applying XSLT here, too, for convenience). Such subcommand was called pcs2pcscmd-needle and (in a buggy state) introduced in clufter-0.50.0. As of commit https://github.com/jnpkrn/clufter/commit/bac7040 the bugs were fixed and knowledge of minimal CIB added, hence one can use following to exploit that subcommand for corosync.conf -> XML conversion: $ FILE=$(clufter pcs2pcscmd-needle --dump simpleconfig2needlexml \ INPUT.conf {cib2pcscmd.in_format.void_file} /dev/null \ 2>&1 | sed -n 's/.* dump file: \(.*\)/\1/p') $ [ DO-SOMETHING-WITH-$FILE-THEN-REMOVE-IT ] Even though Corosync v2 carries files supporting XML variant of its configuration: /etc/corosync/corosync.xml.example /usr/bin/corosync-xmlproc /usr/share/corosync/xml2conf.xsl /usr/share/man/man8/corosync-xmlproc.8.gz the format doesn't seem to be popular at all, which also doesn't warrant a dedicated "needle2needlexml" (or so) subcommand in clufter at this point (despite it would be pretty easy, ditto combining the right filters when using clufter as a Python library). Does the above recipe work for your usecase, Patrik?
works for me, thanks!
clufter-0.50.1-1.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/clufter-0.50.1-1.fc21
clufter-0.50.1-1.fc22 has been submitted as an update for Fedora 22. https://admin.fedoraproject.org/updates/clufter-0.50.1-1.fc22
Package clufter-0.50.1-1.fc22: * should fix your issue, * was pushed to the Fedora 22 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing clufter-0.50.1-1.fc22' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-11770/clufter-0.50.1-1.fc22 then log in and leave karma (feedback).
clufter-0.50.1-1.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.
clufter-0.50.1-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.
re [comment 3]: Please note that as of upcoming clufter release > 0.50.5, the sed command will have to be slightly modifed into something like (untested, but should be backward compatible): sed -n 's/.* dump[^:]*: \(.*\)/\1/p