Bug 1205786
Summary: | [RFE][QA] Conversion of corosync.conf to better format | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Patrik Hagara <phagara> |
Component: | clufter | Assignee: | Jan Pokorný [poki] <jpokorny> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | jpokorny, phagara |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | clufter-0.50.1-1.fc22 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-07-30 00:41:24 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Patrik Hagara
2015-03-25 15:37:39 UTC
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 |