summaryrefslogtreecommitdiffstats
path: root/formats
Commit message (Collapse)AuthorAgeFilesLines
* formats/command: _escape: be more smart about what & howJan Pokorný2015-12-171-4/+9
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/command[separated]: generalize option + X args w/ magic_splitJan Pokorný2015-12-171-5/+8
| | | | | | Moreover, make testMagicBytestringToDict test passing again. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/command[separated]: option + 1 arg as a general assumptionJan Pokorný2015-12-171-4/+8
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/corosync.rng: log destinations can also be on/offJan Pokorný2015-12-171-0/+12
| | | | | | ... in addition to yes/no. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/corosync.rng: fix/extend *_{facility,priority} valuesJan Pokorný2015-12-171-0/+26
| | | | | | | | Based on: - facility: libqb/lib/log_format.c:facilitynames - priority: corosync/exec/logsys.c:prioritynames Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/command: fix issue 'a=b' coercing to "separated"Jan Pokorný2015-12-171-3/+2
| | | | | | Also add a unit test targeting this issue. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* format: add optional knowledge of a "void"/minimal fileJan Pokorný2015-07-142-0/+22
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/simpleconfig: fix issues with a grammar sampleJan Pokorný2015-07-021-4/+4
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* filters/simpleconfig-normalize: new filter + unit testJan Pokorný2015-07-021-0/+2
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/simpleconfig: simpleconfig-normalized specializationJan Pokorný2015-07-021-1/+23
| | | | | | Also fix a typo in simpleconfig pseudo-grammar. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/simpleconfig: implement string->struct + testJan Pokorný2015-07-021-2/+25
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/simpleconfig: "constantify" the lexical unitsJan Pokorný2015-07-021-1/+8
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/simpleconfig: fix missing newline at the endJan Pokorný2015-07-021-2/+2
| | | | | | (which is implicitly assumed and was present before a rewrite) Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/simpleconfig: loosen desired notation a bitJan Pokorný2015-07-021-15/+15
| | | | | | | Thanks to more tolerant "pretty-printer" and also with respect to what target structuring will be optimal for the parser. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/simpleconfig: simplify (crazy) get_bytestringJan Pokorný2015-07-021-37/+20
| | | | | | | | | | | Beside being much more legible, it is also (almost unnoticably) faster, mainly due to not increasing the indentation step by step along the return from recursion. "previous apply_aggregation_preserving_passing_depth attempt was unsuccessful" -- oh, well. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/corosync.rng: add forgotten, long-standing ip_version optionJan Pokorný2015-07-021-0/+12
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/corosync.rng: reflect new token_coefficient optionJan Pokorný2015-07-021-0/+13
| | | | | | (introduced in Corosync v2.3.4) Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/command: need to preserve quotation infoJan Pokorný2015-07-021-0/+24
| | | | | | | | | | ... otherwise original quotation is not preserved in, say, ccs2pcscmd(-flatiron) command due to command format usage in cmd-wrap filter (--noop=cmd-wrap would serve as a workaround before this fix). Also add a respective unit test. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* filters/cmd-wrap: new filter (promoting command format)Jan Pokorný2015-07-021-0/+95
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/string_iter: (always for now) add a trailing newlineJan Pokorný2015-04-151-2/+6
| | | | | | | | First, it's a convention, second, it looks way better when outputting the list on stdout (line is not interleaved with subsequent shell prompt). Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* filters/string-{iter,list,set}: move from ext-plugins/lib-generalJan Pokorný2015-04-151-0/+40
| | | | | | | This is for upcoming cluster.conf (Pacemaker) + CIB -> sequence of pcs commands conversion. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* refactor: pcs (not in command names) -> cibJan Pokorný2015-04-081-10/+10
| | | | | | "pcs" should be reserved for actual pcs CLI tool commands. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/command: move to ext-plugins/lib-general/formatsJan Pokorný2015-01-091-85/+0
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/simpleconfig: allow env override for indentationJan Pokorný2014-11-241-1/+2
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* filters/ccs2needlexml: handle secauth on vs. missing keyfileJan Pokorný2014-11-241-0/+10
| | | | | | Also extend corosync.rng (target=needle format) with missing key{,file}. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/command: "dict" protocol backed by OrderedDictJan Pokorný2014-11-241-1/+13
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/command: plug "dict" protocol inJan Pokorný2014-11-141-0/+20
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/command: bytestring->merged: normalize: -a=b -> -a, bJan Pokorný2014-11-141-2/+10
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/command: turn condition test O(n) to O(1)Jan Pokorný2014-11-141-1/+1
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/command: use "chained" facility as a DRY measureJan Pokorný2014-11-141-7/+2
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* format: make passing protocol/protodecl optionalJan Pokorný2014-11-142-5/+5
| | | | | | | It is usually not used internally to allow "1 function, more roles" anyway. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/command: parsing/linearizing a command + testsJan Pokorný2014-11-141-0/+50
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* commands/ccs2pcs: new extra finalizing pcs2pcsfinal passJan Pokorný2014-10-211-0/+7
| | | | | | | Meant to be easily omissible/suppressable with "--noop=pcs2pcsfinal" provided on command-line or an equivalent. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* commands/ccs2pcs: apparently at least one more pass neededJan Pokorný2014-10-211-0/+7
| | | | | | | | | | | | | | | So the progress for ccs-to-pcs (in isolation) currently is: - ccs2ccsflat - ccs-revitalize - ccsflat2pcsprelude - pcsprelude2pcscompact . TODO: service arrangement(?) - pcscompact2pcs . TODO: stonith-enabled=false if no fencing present and other finalizations Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* ccs2pcs: big renaming (ccsflat2pcsprelude + pcsprelude2pcs)Jan Pokorný2014-10-212-3/+9
| | | | | | | | | Also make distinguishing more restricted internal variants of the formats more explicit (ccsflat, pcsprelude) -- this is known to cause a little regression (format checking too strict to cope with this) and the fix for that is forthcoming. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* Reconsider plugin (class/symbol) to module organizationJan Pokorný2014-09-052-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a preparation work for being able to pick up plugin of choice nicely without the necessity of scanning the whole name/path space followed with some initialization routines across all plugins even if they won't be used for sure. Such heavy-weight approach is fine for using clufter as CLI tool (covering potentially any available use-case), not so much for the use as a library with presumably a priori determined task to perform. As generally one module can (and often is practical!) contain several modules, we are introducing following convention to allow our proposed filtering to have a good false-positives/convenience ratio: module shall contain only plugins the name of which contains the same prefix as the module's filename does, where the prefix is assumed the part before first occurrence of '_' ('-' for stringified/decorated plugin names) As a concrete example, formats/ccs.py module contains ccs and ccs_flat plugins, hence when ccs_flat is to be picked with this fine granularity and using default search path, only formats/ccs.py file will match the prefix test and hence only ccs and ccs_flat will be prepared for further use (one false positive in this case is a result of the mentioned trade-off). This commit normalizes the plugin-module allocation to follow the convention, reflects these changes in tests, etc. and adds a note to the HACKING doc file. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/corosync: uidgid? -> uidgid* in corosync.rngJan Pokorný2014-09-011-2/+2
| | | | | | (Thanks to Tomas Jelinek) Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* format: syntactic sugar for distilling particular representationJan Pokorný2014-09-011-1/+1
| | | | | | self(self.PROTO, ...) -> self.PROTO(...) Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* (Optionally) promote protocols to first-class entityJan Pokorný2014-08-294-9/+11
| | | | | | | | | | | | + reflect that on the formats' level (also bring a convention for that) + make plugin_registry.probe fnc more tolerant towards non-classes as we want to differentiate between protocol on instance basis rather than based on dedicated classes (because we want to pragmatically maintain interchangeability with plain strings!) + make extra steps in protocol.py so the mentioned interchangeability actually works Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* Elaborate more on RGManager's explicit ordering/ccs_flattenJan Pokorný2014-08-261-2/+5
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/pcs: specify validation + add necessary filesJan Pokorný2014-05-304-1/+3653
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* tests: check validation harness using now fixed corosync.rngJan Pokorný2014-05-301-1/+1
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* format: ccs: split out ccs-needle, capable of being validatedJan Pokorný2014-05-301-0/+7
| | | | | | ... using already present corosync.rng Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* format: implement XML validation based on Relax NG schemasJan Pokorný2014-05-303-1/+10
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* Relicence GPLv2 -> GPLv2+Jan Pokorný2014-04-254-4/+4
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* s/ccsflat/flatccs/ (consistency with "simplepcs")Jan Pokorný2014-04-151-2/+2
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* Refactor: move functional-paradigm helpers utils -> utils_funcJan Pokorný2014-04-011-1/+2
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* formats/simpleconfig: append trailing newline to bytestring formJan Pokorný2014-03-071-1/+1
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* format + simpleconfig: prevent unneeded deepcopy (of tuple)Jan Pokorný2014-02-191-2/+3
| | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* ccs2pcs now indeed produces corosync.conf (via XML2simpleconfig)Jan Pokorný2014-02-181-7/+94
| | | | | | | | | which required finalizing some missing functionality: - XML's 'etree' -> simpleconfig's 'struct' (filters/XML2simpleconfig) - simpleconfig's 'struct' produced/pretty-printed as 'bytestring' (formats/simpleconfig) Signed-off-by: Jan Pokorný <jpokorny@redhat.com>