Hello community, here is the log from the commit of package crmsh for openSUSE:Factory checked in at 2015-08-11 08:26:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/crmsh (Old) and /work/SRC/openSUSE:Factory/.crmsh.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "crmsh" Changes: -------- --- /work/SRC/openSUSE:Factory/crmsh/crmsh.changes 2015-07-14 17:44:19.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.crmsh.new/crmsh.changes 2015-08-11 08:26:40.000000000 +0200 @@ -1,0 +2,7 @@ +Mon Aug 10 07:58:45 UTC 2015 - kgronl...@suse.com + +- Update to version 2.2.0~rc3+git.1438934728.5abada2: + + Medium: cibconfig: skip sanity check for properties other than cib-bootstrap-options + + high: parse: Add attributes to terminator set (bsc#940920) + +------------------------------------------------------------------- Old: ---- crmsh-2.2.0~rc3+git.1436439891.2cc4984.tar.bz2 New: ---- crmsh-2.2.0~rc3+git.1438934728.5abada2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ crmsh.spec ++++++ --- /var/tmp/diff_new_pack.h61Dnx/_old 2015-08-11 08:26:40.000000000 +0200 +++ /var/tmp/diff_new_pack.h61Dnx/_new 2015-08-11 08:26:40.000000000 +0200 @@ -36,8 +36,8 @@ Summary: High Availability cluster command-line interface License: GPL-2.0+ Group: %{pkg_group} -Version: 2.2.0~rc3+git.1436439891.2cc4984 -Release: 0%{?crmsh_release}%{?dist} +Version: 2.2.0~rc3+git.1438934728.5abada2 +Release: 0 Url: http://crmsh.github.io Source0: %{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.h61Dnx/_old 2015-08-11 08:26:40.000000000 +0200 +++ /var/tmp/diff_new_pack.h61Dnx/_new 2015-08-11 08:26:40.000000000 +0200 @@ -1,4 +1,4 @@ <servicedata> <service name="tar_scm"> <param name="url">git://github.com/ClusterLabs/crmsh.git</param> - <param name="changesrevision">2cc4984e51e1f9dcd09aa79bc6c4cfb8e2630e5a</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">5abada255a1d0597ea613973339030b49b4cf9e1</param></service></servicedata> \ No newline at end of file ++++++ crmsh-2.2.0~rc3+git.1436439891.2cc4984.tar.bz2 -> crmsh-2.2.0~rc3+git.1438934728.5abada2.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-2.2.0~rc3+git.1436439891.2cc4984/modules/cibconfig.py new/crmsh-2.2.0~rc3+git.1438934728.5abada2/modules/cibconfig.py --- old/crmsh-2.2.0~rc3+git.1436439891.2cc4984/modules/cibconfig.py 2015-07-09 13:12:16.000000000 +0200 +++ new/crmsh-2.2.0~rc3+git.1438934728.5abada2/modules/cibconfig.py 2015-08-10 09:58:45.000000000 +0200 @@ -1879,6 +1879,12 @@ return utils.get_check_rc() l = [] if self.obj_type == "property": + # don't check property sets which are not + # "cib-bootstrap-options", they are probably used by + # some resource agents such as mysql to store RA + # specific state + if self.obj_id != cib_object_map[self.xml_obj_type][3]: + return 0 l = get_properties_list() l += constants.extra_cluster_properties elif self.obj_type == "op_defaults": diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-2.2.0~rc3+git.1436439891.2cc4984/modules/parse.py new/crmsh-2.2.0~rc3+git.1438934728.5abada2/modules/parse.py --- old/crmsh-2.2.0~rc3+git.1436439891.2cc4984/modules/parse.py 2015-07-09 13:12:16.000000000 +0200 +++ new/crmsh-2.2.0~rc3+git.1438934728.5abada2/modules/parse.py 2015-08-10 09:58:45.000000000 +0200 @@ -314,7 +314,7 @@ _UNARYOP_RE = re.compile(r'(%s)$' % ('|'.join(constants.unary_ops)), re.IGNORECASE) _BINOP_RE = None - _TERMINATORS = ('params', 'meta', 'utilization', 'operations', 'op', 'rule') + _TERMINATORS = ('params', 'meta', 'utilization', 'operations', 'op', 'rule', 'attributes') def match_attr_list(self, name, tag, allow_empty=True): """ @@ -508,6 +508,43 @@ else: return ['score-attribute', score] + def match_arguments(self, out, name_map, implicit_initial=None): + """ + [<name> attr_list] + [operations id_spec] + [op op_type [<attribute>=<value> ...] ...] + + attr_list :: [$id=<id>] <attr>=<val> [<attr>=<val>...] | $id-ref=<id> + id_spec :: $id=<id> | $id-ref=<id> + op_type :: start | stop | monitor + + implicit_initial: when matching attr lists, if none match at first + parse an implicit initial token and then continue. + This is so for example: primitive foo Dummy state=1 is accepted when + params is the implicit initial. + """ + names = olist(name_map.keys()) + oplist = olist([op for op in name_map if op.lower() in ('operations', 'op')]) + for op in oplist: + del name_map[op] + initial = True + while self.has_tokens(): + t = self.current_token().lower() + if t in names: + initial = False + if t in oplist: + self.match_operations(out, t == 'operations') + else: + for attr_list in self.match_attr_lists(name_map): + out.append(attr_list) + elif initial: + initial = False + for attr_list in self.match_attr_lists(name_map, + implicit_initial=implicit_initial): + out.append(attr_list) + else: + break + class NodeParser(RuleParser): _UNAME_RE = re.compile(r'([^:]+)(:(normal|member|ping|remote))?$', re.IGNORECASE) @@ -535,10 +572,9 @@ else: out.set("type", self.matched(3) or constants.node_default_type) xmlbuilder.maybe_set(out, "description", self.try_match_description()) - for attr_list in self.match_attr_lists({'attributes': 'instance_attributes', - 'utilization': 'utilization'}, - implicit_initial='attributes'): - out.append(attr_list) + self.match_arguments(out, {'attributes': 'instance_attributes', + 'utilization': 'utilization'}, + implicit_initial='attributes') return out @@ -615,43 +651,6 @@ while is_op(): self.match_op(node, pfx=pfx) - def match_arguments(self, out, name_map, implicit_initial=None): - """ - [<name> attr_list] - [operations id_spec] - [op op_type [<attribute>=<value> ...] ...] - - attr_list :: [$id=<id>] <attr>=<val> [<attr>=<val>...] | $id-ref=<id> - id_spec :: $id=<id> | $id-ref=<id> - op_type :: start | stop | monitor - - implicit_initial: when matching attr lists, if none match at first - parse an implicit initial token and then continue. - This is so for example: primitive foo Dummy state=1 is accepted when - params is the implicit initial. - """ - names = olist(name_map.keys()) - oplist = olist([op for op in name_map if op.lower() in ('operations', 'op')]) - for op in oplist: - del name_map[op] - initial = True - while self.has_tokens(): - t = self.current_token().lower() - if t in names: - initial = False - if t in oplist: - self.match_operations(out, t == 'operations') - else: - for attr_list in self.match_attr_lists(name_map): - out.append(attr_list) - elif initial: - initial = False - for attr_list in self.match_attr_lists(name_map, - implicit_initial=implicit_initial): - out.append(attr_list) - else: - break - def parse(self, cmd): return self.begin_dispatch(cmd, min_args=2) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-2.2.0~rc3+git.1436439891.2cc4984/test/testcases/ra.exp new/crmsh-2.2.0~rc3+git.1438934728.5abada2/test/testcases/ra.exp --- old/crmsh-2.2.0~rc3+git.1436439891.2cc4984/test/testcases/ra.exp 2015-07-09 13:12:16.000000000 +0200 +++ new/crmsh-2.2.0~rc3+git.1438934728.5abada2/test/testcases/ra.exp 2015-08-10 09:58:45.000000000 +0200 @@ -25,6 +25,9 @@ state (string, [/var/run//Dummy-{OCF_RESOURCE_INSTANCE}.state]): State file Location to store the resource state in. +passwd (string): Password + Fake password field + fake (string, [dummy]): Fake attribute that can be changed to cause a reload diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-2.2.0~rc3+git.1436439891.2cc4984/test/unittests/test_bugs.py new/crmsh-2.2.0~rc3+git.1438934728.5abada2/test/unittests/test_bugs.py --- old/crmsh-2.2.0~rc3+git.1436439891.2cc4984/test/unittests/test_bugs.py 2015-07-09 13:12:16.000000000 +0200 +++ new/crmsh-2.2.0~rc3+git.1438934728.5abada2/test/unittests/test_bugs.py 2015-08-10 09:58:45.000000000 +0200 @@ -14,10 +14,11 @@ "set up test fixtures" from crmsh import idmgmt idmgmt.clear() + factory._push_state() def teardown_func(): - pass + factory._pop_state() @with_setup(setup_func, teardown_func) @@ -451,3 +452,27 @@ exp = 'primitive q1 ocf:pacemaker:Dummy params state="foo\\"foo\\""' assert data == exp assert obj.cli_use_validate() + + +@with_setup(setup_func, teardown_func) +def test_nodeattrs(): + """ + bug with parsing node attrs + """ + xml = '''<node id="1" uname="dell71"> \ + <instance_attributes id="dell71-instance_attributes"> \ + <nvpair name="staging-0-0-placement" value="true" id="dell71-instance_attributes-staging-0-0-placement"/> \ + <nvpair name="meta-0-0-placement" value="true" id="dell71-instance_attributes-meta-0-0-placement"/> \ + </instance_attributes> \ + <instance_attributes id="nodes-1"> \ + <nvpair id="nodes-1-standby" name="standby" value="off"/> \ + </instance_attributes> \ +</node>''' + + data = etree.fromstring(xml) + obj = factory.create_from_node(data) + assert obj is not None + data = obj.repr_cli(format=-1) + exp = 'node 1: dell71 attributes staging-0-0-placement=true meta-0-0-placement=true attributes standby=off' + assert data == exp + assert obj.cli_use_validate() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-2.2.0~rc3+git.1436439891.2cc4984/test/unittests/test_cliformat.py new/crmsh-2.2.0~rc3+git.1438934728.5abada2/test/unittests/test_cliformat.py --- old/crmsh-2.2.0~rc3+git.1436439891.2cc4984/test/unittests/test_cliformat.py 2015-07-09 13:12:16.000000000 +0200 +++ new/crmsh-2.2.0~rc3+git.1438934728.5abada2/test/unittests/test_cliformat.py 2015-08-10 09:58:45.000000000 +0200 @@ -206,6 +206,16 @@ @with_setup(setup_func, teardown_func) +def test_multiple_attrsets(): + roundtrip('primitive mySpecialRsc me:Special ' + + 'params 3: interface=eth1 ' + + 'params 2: port=8888') + roundtrip('primitive mySpecialRsc me:Special ' + + 'meta 3: interface=eth1 ' + + 'meta 2: port=8888') + + +@with_setup(setup_func, teardown_func) def test_new_acls(): roundtrip('role fum description=test read description=test2 xpath:"*[@name=karl]"')