Hello community,

here is the log from the commit of package crmsh for openSUSE:Factory checked 
in at 2015-01-29 09:56:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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-01-23 
15:47:33.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.crmsh.new/crmsh.changes 2015-01-29 
09:56:26.000000000 +0100
@@ -1,0 +2,19 @@
+Tue Jan 27 14:38:54 UTC 2015 - kgronl...@suse.com
+
+- medium: crm_pssh: Handle incomplete Option argument
+- medium: constants: Fix transition start detection
+- medium: crm_pssh: Make tar follow symlinks
+- medium: cibconfig: Strip digest from v1 diffs (bnc#914098)
+- low: ui_options: Add underscore aliases for legacy options
+- medium: constants: Update transition regex (#77)
+- medium: cibconfig: Detect v1 format and don't patch container changes 
(bnc#914098)
+- medium: orderedset: Add OrderedSet type
+- medium: cibconfig: Use orderedset to avoid reordering bugs (#79)
+- medium: xmlutil: Modify sort order of object types
+- low: xmlutil: logic bug in sanity_check_nvpairs
+- high: xmlutil: Treat node type=member as normal (boo#904698)
+- medium: util: Don't fall back to current time
+- medium: report: Fall back to end_ts = start_ts
+- upstream cs: 2.2.0-rc2-48-ge8853fe
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ crmsh.spec ++++++
--- /var/tmp/diff_new_pack.kRSHMP/_old  2015-01-29 09:56:27.000000000 +0100
+++ /var/tmp/diff_new_pack.kRSHMP/_new  2015-01-29 09:56:27.000000000 +0100
@@ -36,7 +36,7 @@
 Summary:        High Availability cluster command-line interface
 License:        GPL-2.0+
 Group:          %{pkg_group}
-Version:        2.2.0~rc2
+Version:        2.2.0~rc2+git48.ge8853fe
 Release:        %{?crmsh_release}%{?dist}
 Url:            http://crmsh.github.io
 Source0:        crmsh.tar.bz2

++++++ crmsh.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/Makefile.am new/crmsh/Makefile.am
--- old/crmsh/Makefile.am       2015-01-15 17:51:37.000000000 +0100
+++ new/crmsh/Makefile.am       2015-01-26 11:13:52.000000000 +0100
@@ -67,7 +67,7 @@
 testdir                =       $(datadir)/$(PACKAGE)/tests
 test_SCRIPTS   =       test/regression.sh test/evaltest.sh test/cib-tests.sh
 test_DATA      =       test/README.regression test/defaults test/descriptions \
-                       test/crm-interface test/history-test.tar.bz2
+                       test/crm-interface test/history-test.tar.bz2 
test/bugs-test.txt
 
 testcasesdir           =       $(datadir)/$(PACKAGE)/tests/testcases
 testcases_SCRIPTS      =       test/testcases/ra.filter 
test/testcases/common.filter test/testcases/xmlonly.sh 
test/testcases/history.pre test/testcases/history.post
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/crmsh/doc/website-v1/news/2015-01-26-release-2_1_2.adoc 
new/crmsh/doc/website-v1/news/2015-01-26-release-2_1_2.adoc
--- old/crmsh/doc/website-v1/news/2015-01-26-release-2_1_2.adoc 1970-01-01 
01:00:00.000000000 +0100
+++ new/crmsh/doc/website-v1/news/2015-01-26-release-2_1_2.adoc 2015-01-26 
11:13:52.000000000 +0100
@@ -0,0 +1,69 @@
+Announcing crmsh release 2.1.2
+==============================
+:Author: Kristoffer Gronlund
+:Email: kgronl...@suse.com
+:Date: 2015-01-26 11:05
+
+Today we are proud to announce the release of `crmsh` version 2.1.2!
+This version primarily fixes all known issues found since the release
+of `crmsh` 2.1.1 in October. We recommend that all users of crmsh upgrade
+to this version, especially if using Pacemaker 1.1.12 or newer.
+
+A massive thank you to everyone who has helped out with bug fixes,
+comments and contributions for this release!
+
+For a complete list of changes since the previous version, please
+refer to the changelog:
+
+* https://github.com/crmsh/crmsh/blob/2.1.2/ChangeLog
+
+Packages for several popular Linux distributions can be downloaded
+from the Stable repository at the OBS:
+
+* http://download.opensuse.org/repositories/network:/ha-clustering:/Stable/
+
+Archives of the tagged release:
+
+* https://github.com/crmsh/crmsh/archive/2.1.2.tar.gz
+* https://github.com/crmsh/crmsh/archive/2.1.2.zip
+
+Changes since the previous release:
+
+ - medium: ui_resource: Set probe interval 0 if not set (bnc#905050)
+ - doc: Document probe op in resource trace (bnc#905050)
+ - high: config: Fix path to system-wide crm.conf (#67)
+ - medium: config: Fall back to /etc/crm/crmsh.conf (#67)
+ - low: cliformat: Colorize id: as identifier (boo#905338)
+ - medium: cibconfig: Don't bump epoch if stripping version
+ - medium: ui_context: Lazily import readline
+ - medium: config: Add core.ignore_missing_metadata (#68) (boo#905910)
+ - medium: cibconfig: Strip digest from v1 diffs (bnc#914098)
+ - medium: cibconfig: Detect v1 format and don't patch container changes 
(bnc#914098)
+ - high: xmlutil: Treat node type=member as normal (boo#904698)
+ - medium: xmlutil: Use idmgmt when creating new elements (bnc#901543)
+ - low: ui_resource: --reprobe and --refresh are deprecated (bnc#905092)
+ - doc: Document deprecation of refresh and reprobe (bnc#905092)
+ - medium: parse: Support resource-discovery in location constraints
+ - medium: Allow removing groups even if is_running (boo#905271)
+ - medium: cibconfig: Delete containers first in edits (boo#905268)
+ - medium: ui_history: Fix crash using empty object set
+ - Low: term: get rid of annying ^O in piped-to-less-R output
+ - medium: parse: Allow nvpair with no value using name= syntax (#71)
+ - medium: parse: Enable name[=value] for nvpair (#71)
+ - medium: utils: Check if path basename is less (#74)
+ - medium: utils: crm_daemon_dir is added to PATH in envsetup (#67)
+ - medium: cmd_status: Show pending if available, enable extra options
+ - high: utils: Locate binaries across sudo boundary (bnc#912483)
+ - Medium: history: match error/crit messages of pcmk 1.1.12
+ - low: ui_options: Add underscore aliases for legacy options
+ - medium: constants: Fix transition start detection
+ - medium: constants: Update transition regex (#77)
+ - medium: orderedset: Add OrderedSet type
+ - medium: cibconfig: Use orderedset to avoid reordering bugs (#79)
+ - low: xmlutil: logic bug in sanity_check_nvpairs
+ - medium: util: Don't fall back to current time
+ - medium: report: Fall back to end_ts = start_ts
+
+Thank you,
+
+Kristoffer and Dejan
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/doc/website-v1/news.adoc 
new/crmsh/doc/website-v1/news.adoc
--- old/crmsh/doc/website-v1/news.adoc  2015-01-15 17:51:37.000000000 +0100
+++ new/crmsh/doc/website-v1/news.adoc  2015-01-26 11:13:52.000000000 +0100
@@ -1,14 +1,15 @@
 = News
 
-link:/news/2014-10-28-release-2_1_1[2014-10-29 00:20]
+link:/news/2015-01-26-release-2_1_2[2015-01-26 11:05]
 
 :leveloffset: 1
 
-include::news/2014-10-28-release-2_1_1.adoc[]
+include::news/2015-01-26-release-2_1_2.adoc[]
 
 :leveloffset: 0
 
 ''''
+* link:/news/2014-10-28-release-2_1_1[2014-10-29 00:20 Announcing crmsh 
release 2.1.1]
 * link:/news/2014-06-30-release-2_1[2014-06-30 09:00 Announcing crmsh release 
2.1]
 
 link:https://savannah.nongnu.org/news/?group_id=10890[Old News Archive]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/modules/cibconfig.py 
new/crmsh/modules/cibconfig.py
--- old/crmsh/modules/cibconfig.py      2015-01-15 17:51:37.000000000 +0100
+++ new/crmsh/modules/cibconfig.py      2015-01-26 11:13:52.000000000 +0100
@@ -44,6 +44,7 @@
 from utils import page_string, cibadmin_can_patch, str2tmp
 from utils import run_ptest, is_id_valid, edit_file, get_boolean, filter_string
 from ordereddict import odict
+from orderedset import oset
 from xmlutil import is_child_rsc, rsc_constraint, sanitize_cib, rename_id, 
get_interesting_nodes
 from xmlutil import is_pref_location, get_topnode, new_cib, 
get_rscop_defaults_meta_node
 from xmlutil import rename_rscref, is_ms, silly_constraint, is_container, 
fix_comments
@@ -258,8 +259,8 @@
         rc, self.obj_set = cib_factory.mkobj_set(*self.args)
         self.search_rc = rc
         self.all_set = cib_factory.get_all_obj_set()
-        self.obj_ids = set([o.obj_id for o in self.obj_set])
-        self.all_ids = set([o.obj_id for o in self.all_set])
+        self.obj_ids = oset([o.obj_id for o in self.obj_set])
+        self.all_ids = oset([o.obj_id for o in self.all_set])
         self.locked_ids = self.all_ids - self.obj_ids
 
     def _open_url(self, src):
@@ -584,8 +585,8 @@
         changes are made.
         '''
         edit_d = {}
-        id_set = set()
-        del_set = set()
+        id_set = oset()
+        del_set = oset()
         rc = True
         err_buf.start_tmp_lineno()
         cp = CliParser()
@@ -652,8 +653,8 @@
         if not show_unrecognized_elems(cib_elem):
             return False
         rc = True
-        id_set = set()
-        del_set = set()
+        id_set = oset()
+        del_set = oset()
         edit_d = {}
         for node in get_top_cib_nodes(cib_elem, []):
             id = self._get_id(node)
@@ -2403,6 +2404,16 @@
             for tag in e.xpath("./version/*[self::target or self::source]"):
                 tag.attrib.clear()
             cib_diff = etree.tostring(e)
+        # for v1 diffs, fall back to non-patching if
+        # any containers are modified, else strip the digest
+        if "<diff" in cib_diff and "digest=" in cib_diff:
+            if not self.can_patch_v1():
+                return self._replace_cib(force)
+            e = etree.fromstring(cib_diff)
+            for tag in e.xpath("/diff"):
+                if "digest" in tag.attrib:
+                    del tag.attrib["digest"]
+            cib_diff = etree.tostring(e)
         common_debug("Diff: %s" % (cib_diff))
         rc = pipe_string("%s %s" % (cib_piped, cibadmin_opts),
                          cib_diff)
@@ -2411,6 +2422,23 @@
             return False
         return True
 
+    def can_patch_v1(self):
+        """
+        The v1 patch format cannot handle reordering,
+        so if there are any changes to any containers
+        or acl tags, don't patch.
+        """
+        def group_changed():
+            for obj in self.cib_objects:
+                if not obj.updated:
+                    continue
+                if obj.obj_type in constants.container_tags:
+                    return True
+                if obj.obj_type in ('user', 'role', 'acl_target', 'acl_group'):
+                    return True
+            return False
+        return not group_changed()
+
     #
     # initialize cib_objects from CIB
     #
@@ -2823,14 +2851,14 @@
         if args[0] == "NOOBJ":
             return True, []
         rc = True
-        obj_set = set([])
+        obj_set = oset([])
         for spec in args:
             if spec == "changed":
-                obj_set |= set(self.modified_elems())
+                obj_set |= oset(self.modified_elems())
             elif spec.startswith("type:"):
-                obj_set |= set(self.get_elems_on_type(spec))
+                obj_set |= oset(self.get_elems_on_type(spec))
             elif spec.startswith("tag:"):
-                obj_set |= set(self.get_elems_on_tag(spec))
+                obj_set |= oset(self.get_elems_on_tag(spec))
             else:
                 objs = self.find_objects(spec) or []
                 for obj in objs:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/modules/constants.py 
new/crmsh/modules/constants.py
--- old/crmsh/modules/constants.py      2015-01-15 17:51:37.000000000 +0100
+++ new/crmsh/modules/constants.py      2015-01-26 11:13:52.000000000 +0100
@@ -272,7 +272,7 @@
 # r.group(3) file number
 transition_patt = [
     # transition start
-    "crmd.* do_te_invoke: Processing graph ([0-9]+) .*derived from 
(.*/pe-[^-]+-(%%)[.]bz2)",
+    "pengine.* process_pe_message: .*Transition ([0-9]+): .*([^ 
]*/pe-[^-]+-(%%)[.]bz2)",
     # r.group(1) transition number (a different thing from file number)
     # r.group(2) contains full path
     # r.group(3) transition status
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/modules/crm_pssh.py 
new/crmsh/modules/crm_pssh.py
--- old/crmsh/modules/crm_pssh.py       2015-01-15 17:51:37.000000000 +0100
+++ new/crmsh/modules/crm_pssh.py       2015-01-26 11:13:52.000000000 +0100
@@ -85,14 +85,14 @@
                '-o', 'PasswordAuthentication=no',
                '-o', 'SendEnv=PSSH_NODENUM',
                '-o', 'StrictHostKeyChecking=no']
-        if opts.options:
+        if hasattr(opts, 'options'):
             for opt in opts.options:
                 cmd += ['-o', opt]
         if user:
             cmd += ['-l', user]
         if port:
             cmd += ['-p', port]
-        if opts.extra:
+        if hasattr(opts, 'extra'):
             cmd.extend(opts.extra)
         if cmdline:
             cmd.append(cmdline)
@@ -173,7 +173,7 @@
         dir = "/%s" % r.group(1)
         red_pe_l = [x.replace("%s/" % r.group(1), "") for x in pe_l]
         common_debug("getting new PE inputs %s from %s" % (red_pe_l, node))
-        cmdline = "tar -C %s -cf - %s" % (dir, ' '.join(red_pe_l))
+        cmdline = "tar -C %s -chf - %s" % (dir, ' '.join(red_pe_l))
         opts = parse_args(outdir, errdir)
         l.append([node, cmdline])
     if not l:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/modules/orderedset.py 
new/crmsh/modules/orderedset.py
--- old/crmsh/modules/orderedset.py     1970-01-01 01:00:00.000000000 +0100
+++ new/crmsh/modules/orderedset.py     2015-01-26 11:13:52.000000000 +0100
@@ -0,0 +1,98 @@
+# Copyright (C) 2009 Raymond Hettinger
+
+#                          *** MIT License ***
+# Permission is hereby granted, free of charge, to any person obtaining a copy 
of
+# this software and associated documentation files (the "Software"), to deal in
+# the Software without restriction, including without limitation the rights to
+# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+# of the Software, and to permit persons to whom the Software is furnished to 
do
+# so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in 
all
+# copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+# {{{ http://code.activestate.com/recipes/576694/ (r7)
+
+import collections
+
+KEY, PREV, NEXT = range(3)
+
+
+class OrderedSet(collections.MutableSet):
+
+    def __init__(self, iterable=None):
+        self.end = end = []
+        end += [None, end, end]         # sentinel node for doubly linked list
+        self.map = {}                   # key --> [key, prev, next]
+        if iterable is not None:
+            self |= iterable
+
+    def __len__(self):
+        return len(self.map)
+
+    def __contains__(self, key):
+        return key in self.map
+
+    def add(self, key):
+        if key not in self.map:
+            end = self.end
+            curr = end[PREV]
+            curr[NEXT] = end[PREV] = self.map[key] = [key, curr, end]
+
+    def discard(self, key):
+        if key in self.map:
+            key, prev, next = self.map.pop(key)
+            prev[NEXT] = next
+            next[PREV] = prev
+
+    def __iter__(self):
+        end = self.end
+        curr = end[NEXT]
+        while curr is not end:
+            yield curr[KEY]
+            curr = curr[NEXT]
+
+    def __reversed__(self):
+        end = self.end
+        curr = end[PREV]
+        while curr is not end:
+            yield curr[KEY]
+            curr = curr[PREV]
+
+    def pop(self, last=True):
+        # changed default to last=False - by default, treat as queue.
+        if not self:
+            raise KeyError('set is empty')
+        key = next(reversed(self)) if last else next(iter(self))
+        self.discard(key)
+        return key
+
+    def __repr__(self):
+        if not self:
+            return '%s()' % (self.__class__.__name__,)
+        return '%s(%r)' % (self.__class__.__name__, list(self))
+
+    def __eq__(self, other):
+        if isinstance(other, OrderedSet):
+            return len(self) == len(other) and list(self) == list(other)
+        return set(self) == set(other)
+
+    def __del__(self):
+        self.clear()                    # remove circular references
+
+
+oset = OrderedSet
+
+if __name__ == '__main__':
+    print(OrderedSet('abracadaba'))
+    print(OrderedSet('simsalabim'))
+
+# end of http://code.activestate.com/recipes/576694/ }}}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/modules/report.py new/crmsh/modules/report.py
--- old/crmsh/modules/report.py 2015-01-15 17:51:37.000000000 +0100
+++ new/crmsh/modules/report.py 2015-01-26 11:13:52.000000000 +0100
@@ -551,7 +551,7 @@
         else:
             common_warn("end of transition %s not found in logs (transition 
not complete yet?)" %
                         self)
-            self.end_ts = time.time()
+            self.end_ts = self.start_ts
 
     def actions_count(self):
         if self.run_msg:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/modules/ui_options.py 
new/crmsh/modules/ui_options.py
--- old/crmsh/modules/ui_options.py     2015-01-15 17:51:37.000000000 +0100
+++ new/crmsh/modules/ui_options.py     2015-01-26 11:13:52.000000000 +0100
@@ -89,6 +89,7 @@
         config.set_option(parts[0], parts[1], value)
 
     @command.name('skill-level')
+    @command.alias('skill_level')
     @command.completers(_getprefs('skill_level'))
     def do_skill_level(self, context, level):
         """usage: skill-level <level>
@@ -119,18 +120,21 @@
         return _legacy_set_pref("colorscheme", colors)
 
     @command.name('check-frequency')
+    @command.alias('check_frequency')
     @command.completers(_getprefs('check_frequency'))
     def do_check_frequency(self, context, freq):
         "usage: check-frequency <freq>"
         return _legacy_set_pref("check-frequency", freq)
 
     @command.name('check-mode')
+    @command.alias('check_mode')
     @command.completers(_getprefs('check_mode'))
     def do_check_mode(self, context, mode):
         "usage: check-mode <mode>"
         return _legacy_set_pref("check-mode", mode)
 
     @command.name('sort-elements')
+    @command.alias('sort_elements')
     @command.completers(_yesno)
     def do_sort_elements(self, context, opt):
         "usage: sort-elements {yes|no}"
@@ -142,12 +146,14 @@
         return _legacy_set_pref("wait", opt)
 
     @command.name('add-quotes')
+    @command.alias('add_quotes')
     @command.completers(_yesno)
     def do_add_quotes(self, context, opt):
         "usage: add-quotes {yes|no}"
         return _legacy_set_pref("add-quotes", opt)
 
     @command.name('manage-children')
+    @command.alias('manage_children')
     @command.completers(_getprefs('manage_children'))
     def do_manage_children(self, context, opt):
         "usage: manage-children <option>"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/modules/utils.py new/crmsh/modules/utils.py
--- old/crmsh/modules/utils.py  2015-01-15 17:51:37.000000000 +0100
+++ new/crmsh/modules/utils.py  2015-01-26 11:13:52.000000000 +0100
@@ -760,13 +760,17 @@
 def shorttime(ts):
     if isinstance(ts, datetime.datetime):
         return ts.strftime("%X")
-    return time.strftime("%X", time.localtime(ts))
+    if ts is not None:
+        return time.strftime("%X", time.localtime(ts))
+    return time.strftime("%X", time.localtime(0))
 
 
 def shortdate(ts):
     if isinstance(ts, datetime.datetime):
         return ts.strftime("%F")
-    return time.strftime("%F", time.localtime(ts))
+    if ts is not None:
+        return time.strftime("%F", time.localtime(ts))
+    return time.strftime("%F", time.localtime(0))
 
 
 def sort_by_mtime(l):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/modules/xmlutil.py new/crmsh/modules/xmlutil.py
--- old/crmsh/modules/xmlutil.py        2015-01-15 17:51:37.000000000 +0100
+++ new/crmsh/modules/xmlutil.py        2015-01-26 11:13:52.000000000 +0100
@@ -124,7 +124,7 @@
     rc = 0
     for nvpair in node.iterchildren("nvpair"):
         n = nvpair.get("name")
-        if n and not n in attr_list:
+        if n and n not in attr_list:
             common_err("%s: attribute %s does not exist" % (id, n))
             rc |= utils.get_check_rc()
     return rc
@@ -289,7 +289,7 @@
 
 
 def is_normal_node(n):
-    return n.tag == "node" and (n.get("type") in (None, "normal", ""))
+    return n.tag == "node" and (n.get("type") in (None, "normal", "member", 
""))
 
 
 def unique_ra(typ, klass, provider):
@@ -789,19 +789,22 @@
     return m
 
 
-_sort_xml_order = make_sort_map('node', 'template', 'primitive',
-                                'group', 'master', 'clone',
-                                'rsc_location', 'rsc_colocation',
-                                'rsc_order', 'rsc_ticket', 'fencing-topology',
+_sort_xml_order = make_sort_map('node',
+                                'template', 'primitive', 'group', 'master', 
'clone', 'op',
+                                'tag',
+                                ['rsc_location', 'rsc_colocation', 
'rsc_order'],
+                                ['rsc_ticket', 'fencing-topology'],
                                 'cluster_property_set', 'rsc_defaults', 
'op_defaults',
-                                'op', 'acl_role', 'acl_user', 'tag')
+                                'acl_role', ['acl_target', 'acl_group', 
'acl_user'])
 
-_sort_cli_order = make_sort_map('node', 'rsc_template', 'primitive',
-                                'group', 'ms', 'master', 'clone',
-                                'location', 'colocation', 'collocation',
-                                'order', 'rsc_ticket', 'fencing_topology',
+_sort_cli_order = make_sort_map('node',
+                                'rsc_template', 'primitive', 'group',
+                                ['ms', 'master'], 'clone', 'op',
+                                'tag',
+                                ['location', 'colocation', 'collocation', 
'order'],
+                                ['rsc_ticket', 'fencing_topology'],
                                 'property', 'rsc_defaults', 'op_defaults',
-                                'op', 'role', 'user', 'tag')
+                                'role', ['acl_target', 'acl_group', 'user'])
 
 _SORT_LAST = 1000
 
@@ -810,6 +813,8 @@
     '''
     It's usually important to process cib objects in this order,
     i.e. simple objects first.
+
+    TODO: if sort_elements is disabled, only sort to resolve 
inter-dependencies.
     '''
     if config.core.sort_elements:
         sortfn = lambda k: (_sort_xml_order.get(k.tag, _SORT_LAST), 
k.get('id'))
@@ -822,6 +827,8 @@
     '''
     cl: list of objects (CibObject)
     Returns the given list in order
+
+    TODO: if sort_elements is disabled, only sort to resolve 
inter-dependencies.
     '''
     if config.core.sort_elements:
         sortfn = lambda k: (_sort_cli_order.get(k.obj_type, _SORT_LAST), 
k.obj_id)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/test/bugs-test.txt new/crmsh/test/bugs-test.txt
--- old/crmsh/test/bugs-test.txt        1970-01-01 01:00:00.000000000 +0100
+++ new/crmsh/test/bugs-test.txt        2015-01-26 11:13:52.000000000 +0100
@@ -0,0 +1,11 @@
+node node1
+primitive st stonith:null params hostlist=node1
+property default-action-timeout=60s
+group g1 gr1 gr2
+group g2 gr3
+group g3 gr4
+primitive gr1 Dummy
+primitive gr2 Dummy
+primitive gr3 Dummy
+primitive gr4 Dummy
+location loc1 g1 rule 200: #uname eq node1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/test/testcases/bugs 
new/crmsh/test/testcases/bugs
--- old/crmsh/test/testcases/bugs       2015-01-15 17:51:37.000000000 +0100
+++ new/crmsh/test/testcases/bugs       2015-01-26 11:13:52.000000000 +0100
@@ -1,20 +1,41 @@
-show Configuration bugs
+session Configuration bugs
+options
+sort_elements false
+up
+configure
+erase
 primitive st stonith:null \
        params hostlist='node1' \
        meta description="some description here" \
        op start requires=nothing \
        op monitor interval=60m
-primitive p1 Dummy
-primitive p2 Dummy
-primitive p3 Dummy
 primitive p4 Dummy
+primitive p3 Dummy
+primitive p2 Dummy
+primitive p1 Dummy
 colocation c1 inf: p1 p2
 filter "sed 's/p1 p2/& p3/'" c1
 show c1
 delete c1
 colocation c2 inf: [ p1 p2 ] p3 p4
-filter "sed 's/\[/(/;s/\]/)/'" c2
+filter "sed 's/\\\[/\\\(/;s/\\\]/\\\)/'" c2
 show c2
+primitive p5 Dummy
+primitive p6 Dummy
+clone cl-p5 p5
+show
+commit
+_test
+verify
+show
+.
+session Unordered load file
+options
+sort_elements false
+up
+configure
+load update bugs-test.txt
+show
 commit
 _test
 verify
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/test/testcases/bugs.exp 
new/crmsh/test/testcases/bugs.exp
--- old/crmsh/test/testcases/bugs.exp   2015-01-15 17:51:37.000000000 +0100
+++ new/crmsh/test/testcases/bugs.exp   2015-01-26 11:13:52.000000000 +0100
@@ -1,22 +1,41 @@
 .TRY Configuration bugs
+.INP: options
+.INP: sort_elements false
+.INP: up
 .INP: configure
-.INP: _regtest on
 .INP: erase
-.INP: erase nodes
 .INP: primitive st stonith:null        params hostlist='node1'         meta 
description="some description here"        op start requires=nothing       op 
monitor interval=60m
-.INP: primitive p1 Dummy
-.INP: primitive p2 Dummy
-.INP: primitive p3 Dummy
 .INP: primitive p4 Dummy
+.INP: primitive p3 Dummy
+.INP: primitive p2 Dummy
+.INP: primitive p1 Dummy
 .INP: colocation c1 inf: p1 p2
 .INP: filter "sed 's/p1 p2/& p3/'" c1
 .INP: show c1
 colocation c1 inf: p1 p2 p3
 .INP: delete c1
 .INP: colocation c2 inf: [ p1 p2 ] p3 p4
-.INP: filter "sed 's/[/(/;s/]/)/'" c2
+.INP: filter "sed 's/\[/\(/;s/\]/\)/'" c2
 .INP: show c2
 colocation c2 inf: ( p1 p2 ) p3 p4
+.INP: primitive p5 Dummy
+.INP: primitive p6 Dummy
+.INP: clone cl-p5 p5
+.INP: show
+node node1
+primitive st stonith:null \
+       params hostlist=node1 \
+       meta description="some description here" \
+       op start requires=nothing interval=0 \
+       op monitor interval=60m
+primitive p4 Dummy
+primitive p3 Dummy
+primitive p2 Dummy
+primitive p1 Dummy
+primitive p5 Dummy
+primitive p6 Dummy
+clone cl-p5 p5
+colocation c2 inf: ( p1 p2 ) p3 p4
 .INP: commit
 .EXT crm_resource --show-metadata stonith:heartbeat:null
 .EXT stonithd metadata
@@ -25,16 +44,55 @@
 .INP: _test
 .INP: verify
 .INP: show
-primitive p1 Dummy
-primitive p2 Dummy
-primitive p3 Dummy
-primitive p4 Dummy
+node node1
 primitive st stonith:null \
        params hostlist=node1 \
        meta description="some description here" \
        op start requires=nothing interval=0 \
        op monitor interval=60m
+primitive p4 Dummy
+primitive p3 Dummy
+primitive p2 Dummy
+primitive p1 Dummy
+primitive p6 Dummy
+primitive p5 Dummy
+clone cl-p5 p5
 colocation c2 inf: ( p1 p2 ) p3 p4
+.TRY Unordered load file
+.INP: options
+.INP: sort_elements false
+.INP: up
+.INP: configure
+.INP: load update bugs-test.txt
+.INP: show
+node node1
+primitive st stonith:null \
+       params hostlist=node1
+primitive p4 Dummy
+primitive p3 Dummy
+primitive p2 Dummy
+primitive p1 Dummy
+primitive p6 Dummy
+primitive p5 Dummy
+primitive gr1 Dummy
+primitive gr2 Dummy
+primitive gr3 Dummy
+primitive gr4 Dummy
+group g1 gr1 gr2
+group g2 gr3
+group g3 gr4
+clone cl-p5 p5
+colocation c2 inf: ( p1 p2 ) p3 p4
+location loc1 g1 \
+       rule 200: #uname eq node1
+property cib-bootstrap-options: \
+       default-action-timeout=60s
 .INP: commit
-INFO: 21: apparently there is nothing to commit
-INFO: 21: try changing something first
+.EXT crm_resource --show-metadata stonith:heartbeat:null
+.EXT stonithd metadata
+.EXT crm_resource --show-metadata ocf:heartbeat:Dummy
+.EXT crmd metadata
+.EXT pengine metadata
+.EXT cib metadata
+.INP: _test
+.INP: verify
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/test/testcases/commit.exp 
new/crmsh/test/testcases/commit.exp
--- old/crmsh/test/testcases/commit.exp 2015-01-15 17:51:37.000000000 +0100
+++ new/crmsh/test/testcases/commit.exp 2015-01-26 11:13:52.000000000 +0100
@@ -27,13 +27,13 @@
 .INP: commit
 .EXT crm_resource --show-metadata ocf:heartbeat:Dummy
 .INP: rename p3 pp3
-INFO: 21: resource references in location:l1 updated
 INFO: 21: resource references in colocation:cl1 updated
+INFO: 21: resource references in location:l1 updated
 INFO: 21: resource references in order:o1 updated
 .INP: commit
 .INP: rename pp3 p3
-INFO: 23: resource references in location:l1 updated
 INFO: 23: resource references in colocation:cl1 updated
+INFO: 23: resource references in location:l1 updated
 INFO: 23: resource references in order:o1 updated
 .INP: delete c1
 INFO: 24: resource references in colocation:cl1 updated
@@ -67,8 +67,8 @@
        op monitor interval=60m
 group g1 d1 p2
 group g2 d3
-location l1 p3 100: node1
 colocation cl1 inf: g1 p3
+location l1 p3 100: node1
 order o1 inf: p3 g1
 property cib-bootstrap-options: \
        default-action-timeout=2m
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/test/testcases/confbasic.exp 
new/crmsh/test/testcases/confbasic.exp
--- old/crmsh/test/testcases/confbasic.exp      2015-01-15 17:51:37.000000000 
+0100
+++ new/crmsh/test/testcases/confbasic.exp      2015-01-26 11:13:52.000000000 
+0100
@@ -96,6 +96,9 @@
 ms m6 s6
 clone c d3 \
        meta clone-max=1
+tag t1: m5 m6
+colocation c1 inf: m6 m5
+colocation c2 inf: m5:Master d1:Started
 location l1 g1 100: node1
 location l2 c \
        rule $id=l2-rule1 100: #uname eq node1
@@ -111,16 +114,14 @@
        rule $id-ref=l2-rule1
 location l7 m5 \
        rule $id-ref=l2-rule1
-colocation c1 inf: m6 m5
-colocation c2 inf: m5:Master d1:Started
 order o1 Mandatory: m5 m6
 order o2 Optional: d1:start m5:promote
 order o3 Serialize: m5 m6
 order o4 inf: m5 m6
+fencing_topology st st2
 rsc_ticket ticket-A_m6 ticket-A: m6
 rsc_ticket ticket-B_m6_m5 ticket-B: m6 m5 loss-policy=fence
 rsc_ticket ticket-C_master ticket-C: m6 m5:Master loss-policy=fence
-fencing_topology st st2
 property cib-bootstrap-options: \
        stonith-enabled=true
 property cpset2: \
@@ -130,5 +131,4 @@
 op_defaults opsdef2: \
        rule 100: #uname eq node1 \
        record-pending=true
-tag t1: m5 m6
 .INP: commit
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/test/testcases/edit.exp 
new/crmsh/test/testcases/edit.exp
--- old/crmsh/test/testcases/edit.exp   2015-01-15 17:51:37.000000000 +0100
+++ new/crmsh/test/testcases/edit.exp   2015-01-26 11:13:52.000000000 +0100
@@ -26,7 +26,7 @@
 .INP: primitive d3 ocf:heartbeat:Dummy
 .INP: group g2 d1 d2
 .INP: filter "sed '/g2/s/d1/p1/;/g1/s/p1/d1/'"
-ERROR: 27: Cannot create group:g2: Child primitive:p1 already in group:g1
+ERROR: 27: Cannot create group:g1: Child primitive:d1 already in group:g2
 .INP: filter "sed '/g1/s/d1/p1/;/g2/s/p1/d1/'"
 .INP: filter "sed '$alocation loc-d1 d1 rule $id=r1 -inf: not_defined 
webserver rule $id=r2 webserver: defined webserver'"
 .INP: filter "sed 's/not_defined webserver/& or mem number:lte 0/'" loc-d1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/test/testcases/history.exp 
new/crmsh/test/testcases/history.exp
--- old/crmsh/test/testcases/history.exp        2015-01-15 17:51:37.000000000 
+0100
+++ new/crmsh/test/testcases/history.exp        2015-01-26 11:13:52.000000000 
+0100
@@ -3,6 +3,7 @@
 .INP: source history-test.tar.bz2
 .INP: info
 .EXT tar -xj < history-test.tar.bz2
+WARNING: 3: end of transition xen-e:pe-input-47 not found in logs (transition 
not complete yet?)
 Source: history-test.tar.bz2
 Created on: Fri 14 Dec 19:08:38 UTC 2012
 By: unknown
@@ -10,7 +11,7 @@
 Nodes: xen-d xen-e
 Groups: 
 Resources: d1 s-libvirt
-Transitions: 43 44 45 46 48 272 49 50
+Transitions: 43 44 45 46 47 48 272 49 50
 .INP: node xen-d
 Dec 14 20:06:35 xen-d corosync[5649]:  [MAIN  ] Corosync Cluster Engine 
('1.4.3'): started and ready to provide service.
 Dec 14 20:06:36 xen-d corosync[5649]:  [pcmk  ] info: pcmk_peer_update: memb: 
xen-d 906822154
@@ -182,6 +183,7 @@
 history-test/xen-e/pengine/pe-input-44.bz2
 history-test/xen-e/pengine/pe-input-45.bz2
 history-test/xen-e/pengine/pe-input-46.bz2
+history-test/xen-e/pengine/pe-input-47.bz2
 history-test/xen-e/pengine/pe-input-48.bz2
 history-test/xen-e/pengine/pe-warn-272.bz2
 history-test/xen-e/pengine/pe-input-49.bz2
@@ -193,6 +195,7 @@
 2012-12-14 20:07:19 20:07:23  pe-input-44   cibadmin   root       xen-d
 2012-12-14 20:07:29 20:07:29  pe-input-45   cibadmin   root       xen-d
 2012-12-14 20:07:29 20:07:29  pe-input-46   cibadmin   root       xen-d
+2012-12-14 20:07:37 20:07:37  pe-input-47   cibadmin   root       xen-d
 2012-12-14 20:07:37 20:07:42  pe-input-48   cibadmin   root       xen-d
 2012-12-14 20:07:54 20:07:56  pe-warn-272   cibadmin   root       xen-d
 2012-12-14 20:07:56 20:07:57  pe-input-49   cibadmin   root       xen-d
@@ -214,7 +217,9 @@
 Dec 14 20:08:43 xen-e crmd: [24228]: info: process_lrm_event: LRM operation 
d1_stop_0 (call=11, rc=0, cib-update=125, confirmed=true) ok
 .INP: # reduce report span
 .INP: timeframe "2012-12-14 20:07:30"
+WARNING: 19: end of transition xen-e:pe-input-47 not found in logs (transition 
not complete yet?)
 .INP: peinputs
+history-test/xen-e/pengine/pe-input-47.bz2
 history-test/xen-e/pengine/pe-input-48.bz2
 history-test/xen-e/pengine/pe-warn-272.bz2
 history-test/xen-e/pengine/pe-input-49.bz2
@@ -265,6 +270,7 @@
 Dec 14 20:07:57 xen-d haveged: haveged stopping due to signal 15
 .INP: # reset timeframe
 .INP: timeframe
+WARNING: 29: end of transition xen-e:pe-input-47 not found in logs (transition 
not complete yet?)
 .INP: session save _crmsh_regtest
 .EXT mkdir -p /var/cache/crm/history/session/_crmsh_regtest
 .INP: session load _crmsh_regtest
@@ -277,5 +283,6 @@
 .INP: history
 .INP: session load _crmsh_regtest
 .EXT tar -xj < history-test.tar.bz2
+WARNING: 2: end of transition xen-e:pe-input-47 not found in logs (transition 
not complete yet?)
 .INP: exclude
 corosync|crmd|pengine|stonith-ng|cib|attrd|mgmtd|sshd
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/test/testcases/newfeatures.exp 
new/crmsh/test/testcases/newfeatures.exp
--- old/crmsh/test/testcases/newfeatures.exp    2015-01-15 17:51:37.000000000 
+0100
+++ new/crmsh/test/testcases/newfeatures.exp    2015-01-26 11:13:52.000000000 
+0100
@@ -27,11 +27,11 @@
        meta target-role=Started \
        op start requires=nothing timeout=60s interval=0 \
        op monitor interval=60m timeout=60s
+tag tag1: p0 p1 p2
 location l1 { p0 p1 p2 } inf: node1
 property cib-bootstrap-options: \
        rule #uname eq node1 \
        stonith-enabled=no
-tag tag1: p0 p1 p2
 .INP: _test
 .INP: verify
 .EXT crm_resource --show-metadata stonith:heartbeat:ssh
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh/test/unittests/test_bugs.py 
new/crmsh/test/unittests/test_bugs.py
--- old/crmsh/test/unittests/test_bugs.py       2015-01-15 17:51:37.000000000 
+0100
+++ new/crmsh/test/unittests/test_bugs.py       2015-01-26 11:13:52.000000000 
+0100
@@ -370,3 +370,19 @@
     for op in ops:
         assert 
op.xpath('./instance_attributes/nvpair[@name="trace_ra"]/@value') == ["1"]
     assert set(obj.node.xpath('./operations/op/@name')) == set(['start', 
'stop'])
+
+
+def test_op_role():
+    xml = '''<primitive class="ocf" id="rsc2" provider="pacemaker" 
type="Dummy">
+        <operations>
+          <op id="rsc2-monitor-10" interval="10" name="monitor" 
role="Stopped"/>
+        </operations>
+      </primitive>'''
+    data = etree.fromstring(xml)
+    obj = factory.create_from_node(data)
+    assert obj is not None
+    data = obj.repr_cli(format=-1)
+    print "OUTPUT:", data
+    exp = 'primitive rsc2 ocf:pacemaker:Dummy op monitor interval=10 
role=Stopped'
+    assert data == exp
+    assert obj.cli_use_validate()

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to