Blob Blame History Raw
From e2420c1912b126e2be1818cf6fa52af595ad553b Mon Sep 17 00:00:00 2001
From: Tomas Jelinek <tojeline@redhat.com>
Date: Fri, 17 Apr 2020 13:27:46 +0200
Subject: [PATCH 1/6] Keep autogenerated IDs of set constraints short

---
 pcs/lib/cib/constraint/colocation.py          |   2 +-
 pcs/lib/cib/constraint/constraint.py          |  18 +-
 pcs/lib/cib/constraint/order.py               |   2 +-
 pcs/lib/cib/constraint/resource_set.py        |   5 +-
 pcs/lib/cib/constraint/ticket.py              |   2 +-
 pcs/lib/cib/test/test_constraint.py           |  14 +-
 .../cib/test/test_constraint_colocation.py    |   2 +-
 pcs/lib/cib/test/test_constraint_order.py     |   2 +-
 pcs/lib/cib/test/test_constraint_ticket.py    |   2 +-
 pcs/lib/cib/test/test_resource_set.py         |  12 +-
 .../commands/test/test_constraint_common.py   |  20 +-
 pcs/test/test_constraints.py                  | 202 +++++++++---------
 12 files changed, 141 insertions(+), 142 deletions(-)

diff --git a/pcs/lib/cib/constraint/colocation.py b/pcs/lib/cib/constraint/colocation.py
index 8006a36f..d19522ab 100644
--- a/pcs/lib/cib/constraint/colocation.py
+++ b/pcs/lib/cib/constraint/colocation.py
@@ -20,7 +20,7 @@ def prepare_options_with_set(cib, options, resource_set_list):
     options = constraint.prepare_options(
         tuple(SCORE_NAMES),
         options,
-        partial(constraint.create_id, cib, TAG_NAME, resource_set_list),
+        partial(constraint.create_id, cib, "colocation", resource_set_list),
         partial(check_new_id_applicable, cib, DESCRIPTION),
     )
 
diff --git a/pcs/lib/cib/constraint/constraint.py b/pcs/lib/cib/constraint/constraint.py
index 02af9d02..936918c2 100644
--- a/pcs/lib/cib/constraint/constraint.py
+++ b/pcs/lib/cib/constraint/constraint.py
@@ -98,11 +98,19 @@ def export_plain(element):
     return {"options": export_attributes(element)}
 
 def create_id(cib, type_prefix, resource_set_list):
-    id = "pcs_" +type_prefix +"".join([
-        "_set_"+"_".join(id_set)
-        for id_set in resource_set.extract_id_set_list(resource_set_list)
-    ])
-    return find_unique_id(cib, id)
+    # Create a semi-random id. We need it to be predictable (for testing), short
+    # and somehow different than other ids so that we don't spend much time in
+    # find_unique_id.
+    # Avoid using actual resource names. It makes the id very long (consider 10
+    # or more resources in a set constraint). Also, if a resource is deleted
+    # and therefore removed from the constraint, the id no longer matches the
+    # constraint.
+    resource_ids = []
+    for _set in resource_set_list:
+        resource_ids.extend(_set["ids"])
+    id_part = "".join([_id[0] + _id[-1] for _id in resource_ids][:3])
+    return find_unique_id(cib, "{0}_set_{1}".format(type_prefix, id_part)
+    )
 
 def have_duplicate_resource_sets(element, other_element):
     get_id_set_list = lambda element: [
diff --git a/pcs/lib/cib/constraint/order.py b/pcs/lib/cib/constraint/order.py
index 4c520ae7..6085f0db 100644
--- a/pcs/lib/cib/constraint/order.py
+++ b/pcs/lib/cib/constraint/order.py
@@ -24,7 +24,7 @@ def prepare_options_with_set(cib, options, resource_set_list):
         tuple(ATTRIB.keys()),
         options,
         create_id=partial(
-            constraint.create_id, cib, TAG_NAME, resource_set_list
+            constraint.create_id, cib, "order", resource_set_list
         ),
         validate_id=partial(check_new_id_applicable, cib, DESCRIPTION),
     )
diff --git a/pcs/lib/cib/constraint/resource_set.py b/pcs/lib/cib/constraint/resource_set.py
index 6ec18205..e9833ff7 100644
--- a/pcs/lib/cib/constraint/resource_set.py
+++ b/pcs/lib/cib/constraint/resource_set.py
@@ -39,9 +39,6 @@ def validate_options(options):
                 reports.invalid_option_value(name, value, ATTRIB[name])
             )
 
-def extract_id_set_list(resource_set_list):
-    return [resource_set["ids"] for resource_set in resource_set_list]
-
 def create(parent, resource_set):
     """
     parent - lxml element for append new resource_set
@@ -50,7 +47,7 @@ def create(parent, resource_set):
     element.attrib.update(resource_set["options"])
     element.attrib["id"] = find_unique_id(
         parent.getroottree(),
-        "pcs_rsc_set_{0}".format("_".join(resource_set["ids"]))
+        "{0}_set".format(parent.attrib.get("id", "constraint_set"))
     )
 
     for id in resource_set["ids"]:
diff --git a/pcs/lib/cib/constraint/ticket.py b/pcs/lib/cib/constraint/ticket.py
index a2dbd5fe..cc1413ea 100644
--- a/pcs/lib/cib/constraint/ticket.py
+++ b/pcs/lib/cib/constraint/ticket.py
@@ -48,7 +48,7 @@ def prepare_options_with_set(cib, options, resource_set_list):
         tuple(ATTRIB.keys()),
         options,
         create_id=partial(
-            constraint.create_id, cib, TAG_NAME, resource_set_list
+            constraint.create_id, cib, "ticket", resource_set_list
         ),
         validate_id=partial(tools.check_new_id_applicable, cib, DESCRIPTION),
     )
diff --git a/pcs/lib/cib/test/test_constraint.py b/pcs/lib/cib/test/test_constraint.py
index aa0f21cd..2712a81f 100644
--- a/pcs/lib/cib/test/test_constraint.py
+++ b/pcs/lib/cib/test/test_constraint.py
@@ -263,19 +263,15 @@ class PrepareOptionsTest(TestCase):
         mock_validate_id.assert_called_once_with("invalid")
 
 class CreateIdTest(TestCase):
-    @mock.patch(
-        "pcs.lib.cib.constraint.constraint.resource_set.extract_id_set_list"
-    )
     @mock.patch("pcs.lib.cib.constraint.constraint.find_unique_id")
-    def test_create_id_from_resource_set_list(self, mock_find_id, mock_extract):
-        mock_extract.return_value = [["A", "B"], ["C"]]
+    def test_create_id_from_resource_set_list(self, mock_find_id):
+        resource_set_list = [{"ids": ["A", "B"]}, {"ids": ["C"]}]
         mock_find_id.return_value = "some_id"
         self.assertEqual(
             "some_id",
-            constraint.create_id("cib", "PREFIX", "resource_set_list")
+            constraint.create_id("cib", "PREFIX", resource_set_list)
         )
-        mock_extract.assert_called_once_with("resource_set_list")
-        mock_find_id.assert_called_once_with("cib", "pcs_PREFIX_set_A_B_set_C")
+        mock_find_id.assert_called_once_with("cib", "PREFIX_set_AABBCC")
 
 def fixture_constraint_section(return_value):
     constraint_section = mock.MagicMock()
@@ -359,7 +355,7 @@ class CreateWithSetTest(TestCase):
         assert_xml_equal(etree.tostring(constraint_section).decode(), """
             <constraints>
                 <ticket a="b">
-                    <resource_set c="d" id="pcs_rsc_set_A_B">
+                    <resource_set c="d" id="constraint_set_set">
                         <resource_ref id="A"/>
                         <resource_ref id="B"/>
                     </resource_set>
diff --git a/pcs/lib/cib/test/test_constraint_colocation.py b/pcs/lib/cib/test/test_constraint_colocation.py
index 25923bb3..75f7924c 100644
--- a/pcs/lib/cib/test/test_constraint_colocation.py
+++ b/pcs/lib/cib/test/test_constraint_colocation.py
@@ -36,7 +36,7 @@ class PrepareOptionsWithSetTest(TestCase):
         self.assertEqual(expected_options, self.prepare(options))
         mock_create_id.assert_called_once_with(
             self.cib,
-            colocation.TAG_NAME,
+            "colocation",
             self.resource_set_list
         )
 
diff --git a/pcs/lib/cib/test/test_constraint_order.py b/pcs/lib/cib/test/test_constraint_order.py
index c43fa2c4..4f5719d3 100644
--- a/pcs/lib/cib/test/test_constraint_order.py
+++ b/pcs/lib/cib/test/test_constraint_order.py
@@ -36,7 +36,7 @@ class PrepareOptionsWithSetTest(TestCase):
         self.assertEqual(expected_options, self.prepare(options))
         mock_create_id.assert_called_once_with(
             self.cib,
-            order.TAG_NAME,
+            "order",
             self.resource_set_list
         )
 
diff --git a/pcs/lib/cib/test/test_constraint_ticket.py b/pcs/lib/cib/test/test_constraint_ticket.py
index ff91f255..111c88e8 100644
--- a/pcs/lib/cib/test/test_constraint_ticket.py
+++ b/pcs/lib/cib/test/test_constraint_ticket.py
@@ -183,7 +183,7 @@ class PrepareOptionsWithSetTest(TestCase):
         self.assertEqual(expected_options, self.prepare(options))
         mock_create_id.assert_called_once_with(
             self.cib,
-            ticket.TAG_NAME,
+            "ticket",
             self.resource_set_list
         )
 
diff --git a/pcs/lib/cib/test/test_resource_set.py b/pcs/lib/cib/test/test_resource_set.py
index 5e0d75c2..fda2723e 100644
--- a/pcs/lib/cib/test/test_resource_set.py
+++ b/pcs/lib/cib/test/test_resource_set.py
@@ -60,16 +60,6 @@ class PrepareSetTest(TestCase):
             }),
         )
 
-class ExtractIdListTest(TestCase):
-    def test_return_id_list_from_resource_set_list(self):
-        self.assertEqual(
-            [["A", "B"], ["C", "D"]],
-            resource_set.extract_id_set_list([
-                {"ids": ["A", "B"], "options": {}},
-                {"ids": ["C", "D"], "options": {}},
-            ])
-        )
-
 class CreateTest(TestCase):
     def test_resource_set_to_parent(self):
         constraint_element = etree.Element("constraint")
@@ -79,7 +69,7 @@ class CreateTest(TestCase):
         )
         assert_xml_equal(etree.tostring(constraint_element).decode(), """
             <constraint>
-              <resource_set id="pcs_rsc_set_A_B" sequential="true">
+              <resource_set id="constraint_set_set" sequential="true">
                 <resource_ref id="A"></resource_ref>
                 <resource_ref id="B"></resource_ref>
               </resource_set>
diff --git a/pcs/lib/commands/test/test_constraint_common.py b/pcs/lib/commands/test/test_constraint_common.py
index bf359380..ddbcbe8e 100644
--- a/pcs/lib/commands/test/test_constraint_common.py
+++ b/pcs/lib/commands/test/test_constraint_common.py
@@ -62,11 +62,11 @@ class CreateWithSetTest(TestCase):
         self.env.push_cib.assert_called_once_with()
         self.independent_cib.find(".//constraints").append(etree.XML("""
             <rsc_some id="some_id" symmetrical="true">
-                  <resource_set id="pcs_rsc_set_A_B" role="Master">
+                  <resource_set id="some_id_set" role="Master">
                       <resource_ref id="A"></resource_ref>
                       <resource_ref id="B"></resource_ref>
                   </resource_set>
-                  <resource_set action="start" id="pcs_rsc_set_E_F">
+                  <resource_set action="start" id="some_id_set-1">
                       <resource_ref id="E"></resource_ref>
                       <resource_ref id="F"></resource_ref>
                   </resource_set>
@@ -90,11 +90,11 @@ class CreateWithSetTest(TestCase):
                     'resource_sets': [
                         {
                             'ids': ['A', 'B'],
-                            'options':{'role':'Master', 'id':'pcs_rsc_set_A_B'}
+                            'options':{'role':'Master', 'id':'some_id_set'}
                         },
                         {
                             'ids': ['E', 'F'],
-                            'options':{'action':'start', 'id':'pcs_rsc_set_E_F'}
+                            'options':{'action':'start', 'id':'some_id_set-1'}
                         }
                     ],
                 }]
@@ -115,11 +115,11 @@ class CreateWithSetTest(TestCase):
         constraint_section = self.independent_cib.find(".//constraints")
         constraint_section.append(etree.XML("""
             <rsc_some id="some_id" symmetrical="true">
-                <resource_set id="pcs_rsc_set_A_B" role="Master">
+                <resource_set id="some_id_set" role="Master">
                     <resource_ref id="A"></resource_ref>
                     <resource_ref id="B"></resource_ref>
                 </resource_set>
-                <resource_set action="start" id="pcs_rsc_set_E_F">
+                <resource_set action="start" id="some_id_set-1">
                     <resource_ref id="E"></resource_ref>
                     <resource_ref id="F"></resource_ref>
                 </resource_set>
@@ -127,11 +127,11 @@ class CreateWithSetTest(TestCase):
         """))
         constraint_section.append(etree.XML("""
             <rsc_some id="some_id" symmetrical="true">
-                <resource_set id="pcs_rsc_set_A_B-1" role="Master">
+                <resource_set id="some_id_set-2" role="Master">
                     <resource_ref id="A"></resource_ref>
                     <resource_ref id="B"></resource_ref>
                 </resource_set>
-                <resource_set action="start" id="pcs_rsc_set_E_F-1">
+                <resource_set action="start" id="some_id_set-3">
                     <resource_ref id="E"></resource_ref>
                     <resource_ref id="F"></resource_ref>
                 </resource_set>
@@ -177,7 +177,7 @@ class ShowTest(TestCase):
                 {
                     'resource_sets': [{
                         'ids': ['A', 'B'],
-                        'options': {'role': 'Master', 'id': 'pcs_rsc_set_A_B'},
+                        'options': {'role': 'Master', 'id': 'some_id_set'},
                     }],
                     'options': {'symmetrical': 'true', 'id': 'some_id'}
                 },
@@ -185,7 +185,7 @@ class ShowTest(TestCase):
                     'options': {'symmetrical': 'true', 'id': 'some_id'},
                     'resource_sets': [{
                         'ids': ['E', 'F'],
-                        'options': {'action': 'start', 'id': 'pcs_rsc_set_E_F'}
+                        'options': {'action': 'start', 'id': 'some_id_set-1'}
                     }]
                 }
             ]
diff --git a/pcs/test/test_constraints.py b/pcs/test/test_constraints.py
index 3feaa053..df8594a5 100644
--- a/pcs/test/test_constraints.py
+++ b/pcs/test/test_constraints.py
@@ -581,13 +581,13 @@ Ticket Constraints:
         ac(o, """\
 Colocation Constraints:
   Resource Sets:
-    set D5 D6 D7 require-all=true sequential=false (id:pcs_rsc_set_D5_D6_D7) set D8 D9 action=start require-all=false role=Stopped sequential=true (id:pcs_rsc_set_D8_D9) setoptions score=INFINITY (id:pcs_rsc_colocation_set_D5_D6_D7_set_D8_D9)
-    set D5 D6 (id:pcs_rsc_set_D5_D6) setoptions score=INFINITY (id:pcs_rsc_colocation_set_D5_D6)
-    set D5 D6 action=stop role=Started (id:pcs_rsc_set_D5_D6-1) set D7 D8 action=promote role=Slave (id:pcs_rsc_set_D7_D8) set D8 D9 action=demote role=Master (id:pcs_rsc_set_D8_D9-1) setoptions score=INFINITY (id:pcs_rsc_colocation_set_D5_D6_set_D7_D8_set_D8_D9)
+    set D5 D6 D7 require-all=true sequential=false (id:colocation_set_D5D6D7_set) set D8 D9 action=start require-all=false role=Stopped sequential=true (id:colocation_set_D5D6D7_set-1) setoptions score=INFINITY (id:colocation_set_D5D6D7)
+    set D5 D6 (id:colocation_set_D5D6_set) setoptions score=INFINITY (id:colocation_set_D5D6)
+    set D5 D6 action=stop role=Started (id:colocation_set_D5D6D7-1_set) set D7 D8 action=promote role=Slave (id:colocation_set_D5D6D7-1_set-1) set D8 D9 action=demote role=Master (id:colocation_set_D5D6D7-1_set-2) setoptions score=INFINITY (id:colocation_set_D5D6D7-1)
 """)
         assert r == 0
 
-        o, r = pcs(temp_cib, "constraint remove pcs_rsc_colocation_set_D5_D6")
+        o, r = pcs(temp_cib, "constraint remove colocation_set_D5D6")
         ac(o,"")
         assert r == 0
 
@@ -595,16 +595,16 @@ Colocation Constraints:
         ac(o, """\
 Colocation Constraints:
   Resource Sets:
-    set D5 D6 D7 require-all=true sequential=false (id:pcs_rsc_set_D5_D6_D7) set D8 D9 action=start require-all=false role=Stopped sequential=true (id:pcs_rsc_set_D8_D9) setoptions score=INFINITY (id:pcs_rsc_colocation_set_D5_D6_D7_set_D8_D9)
-    set D5 D6 action=stop role=Started (id:pcs_rsc_set_D5_D6-1) set D7 D8 action=promote role=Slave (id:pcs_rsc_set_D7_D8) set D8 D9 action=demote role=Master (id:pcs_rsc_set_D8_D9-1) setoptions score=INFINITY (id:pcs_rsc_colocation_set_D5_D6_set_D7_D8_set_D8_D9)
+    set D5 D6 D7 require-all=true sequential=false (id:colocation_set_D5D6D7_set) set D8 D9 action=start require-all=false role=Stopped sequential=true (id:colocation_set_D5D6D7_set-1) setoptions score=INFINITY (id:colocation_set_D5D6D7)
+    set D5 D6 action=stop role=Started (id:colocation_set_D5D6D7-1_set) set D7 D8 action=promote role=Slave (id:colocation_set_D5D6D7-1_set-1) set D8 D9 action=demote role=Master (id:colocation_set_D5D6D7-1_set-2) setoptions score=INFINITY (id:colocation_set_D5D6D7-1)
 """)
         assert r == 0
 
         o, r = pcs(temp_cib, "resource delete D5")
         ac(o, outdent(
             """\
-            Removing D5 from set pcs_rsc_set_D5_D6_D7
-            Removing D5 from set pcs_rsc_set_D5_D6-1
+            Removing D5 from set colocation_set_D5D6D7_set
+            Removing D5 from set colocation_set_D5D6D7-1_set
             Deleting Resource - D5
             """
         ))
@@ -613,20 +613,32 @@ Colocation Constraints:
         o, r = pcs(temp_cib, "resource delete D6")
         ac(o, outdent(
             """\
-            Removing D6 from set pcs_rsc_set_D5_D6_D7
-            Removing D6 from set pcs_rsc_set_D5_D6-1
-            Removing set pcs_rsc_set_D5_D6-1
+            Removing D6 from set colocation_set_D5D6D7_set
+            Removing D6 from set colocation_set_D5D6D7-1_set
+            Removing set colocation_set_D5D6D7-1_set
             Deleting Resource - D6
             """
         ))
         assert r == 0
 
         o, r = pcs(temp_cib, "constraint ref D7")
-        ac(o,"Resource: D7\n  pcs_rsc_colocation_set_D5_D6_D7_set_D8_D9\n  pcs_rsc_colocation_set_D5_D6_set_D7_D8_set_D8_D9\n")
+        ac(o, outdent(
+            """\
+            Resource: D7
+              colocation_set_D5D6D7
+              colocation_set_D5D6D7-1
+            """
+        ))
         assert r == 0
 
         o, r = pcs(temp_cib, "constraint ref D8")
-        ac(o,"Resource: D8\n  pcs_rsc_colocation_set_D5_D6_D7_set_D8_D9\n  pcs_rsc_colocation_set_D5_D6_set_D7_D8_set_D8_D9\n")
+        ac(o, outdent(
+            """\
+            Resource: D8
+              colocation_set_D5D6D7
+              colocation_set_D5D6D7-1
+            """
+        ))
         assert r == 0
 
         output, retValue = pcs(temp_cib, "constraint colocation set D1 D2 sequential=foo")
@@ -852,12 +864,12 @@ Colocation Constraints:
         ac(o,"""\
 Ordering Constraints:
   Resource Sets:
-    set D5 D6 D7 require-all=true sequential=false (id:pcs_rsc_set_D5_D6_D7) set D8 D9 action=start require-all=false role=Stopped sequential=true (id:pcs_rsc_set_D8_D9) (id:pcs_rsc_order_set_D5_D6_D7_set_D8_D9)
-    set D5 D6 (id:pcs_rsc_set_D5_D6) (id:pcs_rsc_order_set_D5_D6)
-    set D5 D6 action=stop role=Started (id:pcs_rsc_set_D5_D6-1) set D7 D8 action=promote role=Slave (id:pcs_rsc_set_D7_D8) set D8 D9 action=demote role=Master (id:pcs_rsc_set_D8_D9-1) (id:pcs_rsc_order_set_D5_D6_set_D7_D8_set_D8_D9)
+    set D5 D6 D7 require-all=true sequential=false (id:order_set_D5D6D7_set) set D8 D9 action=start require-all=false role=Stopped sequential=true (id:order_set_D5D6D7_set-1) (id:order_set_D5D6D7)
+    set D5 D6 (id:order_set_D5D6_set) (id:order_set_D5D6)
+    set D5 D6 action=stop role=Started (id:order_set_D5D6D7-1_set) set D7 D8 action=promote role=Slave (id:order_set_D5D6D7-1_set-1) set D8 D9 action=demote role=Master (id:order_set_D5D6D7-1_set-2) (id:order_set_D5D6D7-1)
 """)
 
-        o, r = pcs(temp_cib, "constraint remove pcs_rsc_order_set_D5_D6")
+        o, r = pcs(temp_cib, "constraint remove order_set_D5D6")
         assert r == 0
         ac(o,"")
 
@@ -866,15 +878,15 @@ Ordering Constraints:
         ac(o,"""\
 Ordering Constraints:
   Resource Sets:
-    set D5 D6 D7 require-all=true sequential=false (id:pcs_rsc_set_D5_D6_D7) set D8 D9 action=start require-all=false role=Stopped sequential=true (id:pcs_rsc_set_D8_D9) (id:pcs_rsc_order_set_D5_D6_D7_set_D8_D9)
-    set D5 D6 action=stop role=Started (id:pcs_rsc_set_D5_D6-1) set D7 D8 action=promote role=Slave (id:pcs_rsc_set_D7_D8) set D8 D9 action=demote role=Master (id:pcs_rsc_set_D8_D9-1) (id:pcs_rsc_order_set_D5_D6_set_D7_D8_set_D8_D9)
+    set D5 D6 D7 require-all=true sequential=false (id:order_set_D5D6D7_set) set D8 D9 action=start require-all=false role=Stopped sequential=true (id:order_set_D5D6D7_set-1) (id:order_set_D5D6D7)
+    set D5 D6 action=stop role=Started (id:order_set_D5D6D7-1_set) set D7 D8 action=promote role=Slave (id:order_set_D5D6D7-1_set-1) set D8 D9 action=demote role=Master (id:order_set_D5D6D7-1_set-2) (id:order_set_D5D6D7-1)
 """)
 
         o, r = pcs(temp_cib, "resource delete D5")
         ac(o, outdent(
             """\
-            Removing D5 from set pcs_rsc_set_D5_D6_D7
-            Removing D5 from set pcs_rsc_set_D5_D6-1
+            Removing D5 from set order_set_D5D6D7_set
+            Removing D5 from set order_set_D5D6D7-1_set
             Deleting Resource - D5
             """
         ))
@@ -883,9 +895,9 @@ Ordering Constraints:
         o, r = pcs(temp_cib, "resource delete D6")
         ac(o, outdent(
             """\
-            Removing D6 from set pcs_rsc_set_D5_D6_D7
-            Removing D6 from set pcs_rsc_set_D5_D6-1
-            Removing set pcs_rsc_set_D5_D6-1
+            Removing D6 from set order_set_D5D6D7_set
+            Removing D6 from set order_set_D5D6D7-1_set
+            Removing set order_set_D5D6D7-1_set
             Deleting Resource - D6
             """
         ))
@@ -946,9 +958,9 @@ Error: invalid option 'foo', allowed options are: id, kind, symmetrical
 Location Constraints:
 Ordering Constraints:
   Resource Sets:
-    set D7 require-all=true sequential=false (id:pcs_rsc_set_D5_D6_D7) set D8 D9 action=start require-all=false role=Stopped sequential=true (id:pcs_rsc_set_D8_D9) (id:pcs_rsc_order_set_D5_D6_D7_set_D8_D9)
-    set D7 D8 action=promote role=Slave (id:pcs_rsc_set_D7_D8) set D8 D9 action=demote role=Master (id:pcs_rsc_set_D8_D9-1) (id:pcs_rsc_order_set_D5_D6_set_D7_D8_set_D8_D9)
-    set D1 D2 (id:pcs_rsc_set_D1_D2) setoptions kind=Mandatory symmetrical=false (id:pcs_rsc_order_set_D1_D2)
+    set D7 require-all=true sequential=false (id:order_set_D5D6D7_set) set D8 D9 action=start require-all=false role=Stopped sequential=true (id:order_set_D5D6D7_set-1) (id:order_set_D5D6D7)
+    set D7 D8 action=promote role=Slave (id:order_set_D5D6D7-1_set-1) set D8 D9 action=demote role=Master (id:order_set_D5D6D7-1_set-2) (id:order_set_D5D6D7-1)
+    set D1 D2 (id:order_set_D1D2_set) setoptions kind=Mandatory symmetrical=false (id:order_set_D1D2)
 Colocation Constraints:
 Ticket Constraints:
 """)
@@ -1220,11 +1232,11 @@ Location Constraints:
 Ordering Constraints:
   start stateful1 then start dummy1 (kind:Mandatory) (id:order-stateful1-dummy1-mandatory)
   Resource Sets:
-    set stateful1 dummy1 (id:pcs_rsc_set_stateful1_dummy1) (id:pcs_rsc_order_set_stateful1_dummy1)
+    set stateful1 dummy1 (id:order_set_s1d1_set) (id:order_set_s1d1)
 Colocation Constraints:
   stateful1 with dummy1 (score:INFINITY) (id:colocation-stateful1-dummy1-INFINITY)
   Resource Sets:
-    set stateful1 dummy1 (id:pcs_rsc_set_stateful1_dummy1-1) setoptions score=INFINITY (id:pcs_rsc_colocation_set_stateful1_dummy1)
+    set stateful1 dummy1 (id:colocation_set_s1d1_set) setoptions score=INFINITY (id:colocation_set_s1d1)
 Ticket Constraints:
 """)
         assert r == 0
@@ -1347,14 +1359,14 @@ Ordering Constraints:
   start stateful1-master then start dummy1 (kind:Mandatory) (id:order-stateful1-master-dummy1-mandatory)
   start dummy1 then start statefulG-master (kind:Mandatory) (id:order-dummy1-statefulG-master-mandatory)
   Resource Sets:
-    set stateful1-master dummy1 (id:pcs_rsc_set_stateful1-master_dummy1) (id:pcs_rsc_order_set_stateful1_dummy1)
-    set dummy1 statefulG-master (id:pcs_rsc_set_dummy1_statefulG-master) (id:pcs_rsc_order_set_dummy1_statefulG)
+    set stateful1-master dummy1 (id:order_set_s1d1_set) (id:order_set_s1d1)
+    set dummy1 statefulG-master (id:order_set_d1sG_set) (id:order_set_d1sG)
 Colocation Constraints:
   stateful1-master with dummy1 (score:INFINITY) (id:colocation-stateful1-master-dummy1-INFINITY)
   dummy1 with statefulG-master (score:INFINITY) (id:colocation-dummy1-statefulG-master-INFINITY)
   Resource Sets:
-    set dummy1 stateful1-master (id:pcs_rsc_set_dummy1_stateful1-master) setoptions score=INFINITY (id:pcs_rsc_colocation_set_dummy1_stateful1)
-    set statefulG-master dummy1 (id:pcs_rsc_set_statefulG-master_dummy1) setoptions score=INFINITY (id:pcs_rsc_colocation_set_statefulG_dummy1)
+    set dummy1 stateful1-master (id:colocation_set_d1s1_set) setoptions score=INFINITY (id:colocation_set_d1s1)
+    set statefulG-master dummy1 (id:colocation_set_sGd1_set) setoptions score=INFINITY (id:colocation_set_sGd1)
 Ticket Constraints:
 """)
         self.assertEqual(0, returnVal)
@@ -1398,7 +1410,7 @@ Adding stateful1-master dummy1 (kind: Mandatory) (Options: first-action=start th
         )
         ac(output, """\
 Error: duplicate constraint already exists, use --force to override
-  set stateful1-master dummy1 (id:pcs_rsc_set_stateful1-master_dummy1) (id:pcs_rsc_order_set_stateful1_dummy1)
+  set stateful1-master dummy1 (id:order_set_s1d1_set) (id:order_set_s1d1)
 """)
         self.assertEqual(1, returnVal)
 
@@ -1407,7 +1419,7 @@ Error: duplicate constraint already exists, use --force to override
         )
         ac(output, console_report(
             "Warning: duplicate constraint already exists",
-            "  set stateful1-master dummy1 (id:pcs_rsc_set_stateful1-master_dummy1) (id:pcs_rsc_order_set_stateful1_dummy1)",
+            "  set stateful1-master dummy1 (id:order_set_s1d1_set) (id:order_set_s1d1)",
         ))
         self.assertEqual(0, returnVal)
 
@@ -1431,7 +1443,7 @@ Error: duplicate constraint already exists, use --force to override
         )
         ac(output, """\
 Error: duplicate constraint already exists, use --force to override
-  set dummy1 stateful1-master (id:pcs_rsc_set_dummy1_stateful1-master) setoptions score=INFINITY (id:pcs_rsc_colocation_set_dummy1_stateful1)
+  set dummy1 stateful1-master (id:colocation_set_d1s1_set) setoptions score=INFINITY (id:colocation_set_d1s1)
 """)
         self.assertEqual(1, returnVal)
 
@@ -1440,7 +1452,7 @@ Error: duplicate constraint already exists, use --force to override
         )
         ac(output, console_report(
             "Warning: duplicate constraint already exists",
-            "  set dummy1 stateful1-master (id:pcs_rsc_set_dummy1_stateful1-master) setoptions score=INFINITY (id:pcs_rsc_colocation_set_dummy1_stateful1)",
+            "  set dummy1 stateful1-master (id:colocation_set_d1s1_set) setoptions score=INFINITY (id:colocation_set_d1s1)",
         ))
         self.assertEqual(0, returnVal)
 
@@ -1465,17 +1477,17 @@ Ordering Constraints:
   start dummy1 then start statefulG-master (kind:Mandatory) (id:order-dummy1-statefulG-master-mandatory)
   start stateful1-master then start dummy1 (kind:Mandatory) (id:order-stateful1-master-dummy1-mandatory-1)
   Resource Sets:
-    set stateful1-master dummy1 (id:pcs_rsc_set_stateful1-master_dummy1) (id:pcs_rsc_order_set_stateful1_dummy1)
-    set dummy1 statefulG-master (id:pcs_rsc_set_dummy1_statefulG-master) (id:pcs_rsc_order_set_dummy1_statefulG)
-    set stateful1-master dummy1 (id:pcs_rsc_set_stateful1-master_dummy1-1) (id:pcs_rsc_order_set_stateful1_dummy1-1)
+    set stateful1-master dummy1 (id:order_set_s1d1_set) (id:order_set_s1d1)
+    set dummy1 statefulG-master (id:order_set_d1sG_set) (id:order_set_d1sG)
+    set stateful1-master dummy1 (id:order_set_s1d1-1_set) (id:order_set_s1d1-1)
 Colocation Constraints:
   stateful1-master with dummy1 (score:INFINITY) (id:colocation-stateful1-master-dummy1-INFINITY)
   dummy1 with statefulG-master (score:INFINITY) (id:colocation-dummy1-statefulG-master-INFINITY)
   stateful1-master with dummy1 (score:INFINITY) (id:colocation-stateful1-master-dummy1-INFINITY-1)
   Resource Sets:
-    set dummy1 stateful1-master (id:pcs_rsc_set_dummy1_stateful1-master) setoptions score=INFINITY (id:pcs_rsc_colocation_set_dummy1_stateful1)
-    set statefulG-master dummy1 (id:pcs_rsc_set_statefulG-master_dummy1) setoptions score=INFINITY (id:pcs_rsc_colocation_set_statefulG_dummy1)
-    set dummy1 stateful1-master (id:pcs_rsc_set_dummy1_stateful1-master-1) setoptions score=INFINITY (id:pcs_rsc_colocation_set_dummy1_stateful1-1)
+    set dummy1 stateful1-master (id:colocation_set_d1s1_set) setoptions score=INFINITY (id:colocation_set_d1s1)
+    set statefulG-master dummy1 (id:colocation_set_sGd1_set) setoptions score=INFINITY (id:colocation_set_sGd1)
+    set dummy1 stateful1-master (id:colocation_set_d1s1-1_set) setoptions score=INFINITY (id:colocation_set_d1s1-1)
 Ticket Constraints:
 """)
         self.assertEqual(0, returnVal)
@@ -1587,11 +1599,11 @@ Location Constraints:
 Ordering Constraints:
   start dummy then start dummy1 (kind:Mandatory) (id:order-dummy-dummy1-mandatory)
   Resource Sets:
-    set dummy1 dummy (id:pcs_rsc_set_dummy1_dummy) (id:pcs_rsc_order_set_dummy1_dummy)
+    set dummy1 dummy (id:order_set_d1dy_set) (id:order_set_d1dy)
 Colocation Constraints:
   dummy with dummy1 (score:INFINITY) (id:colocation-dummy-dummy1-INFINITY)
   Resource Sets:
-    set dummy1 dummy (id:pcs_rsc_set_dummy1_dummy-1) setoptions score=INFINITY (id:pcs_rsc_colocation_set_dummy1_dummy)
+    set dummy1 dummy (id:colocation_set_d1dy_set) setoptions score=INFINITY (id:colocation_set_d1dy)
 Ticket Constraints:
 """)
         assert r == 0
@@ -1710,14 +1722,14 @@ Ordering Constraints:
   start dummy-clone then start dummy1 (kind:Mandatory) (id:order-dummy-clone-dummy1-mandatory)
   start dummy1 then start dummyG-clone (kind:Mandatory) (id:order-dummy1-dummyG-clone-mandatory)
   Resource Sets:
-    set dummy1 dummy-clone (id:pcs_rsc_set_dummy1_dummy-clone) (id:pcs_rsc_order_set_dummy1_dummy)
-    set dummyG-clone dummy1 (id:pcs_rsc_set_dummyG-clone_dummy1) (id:pcs_rsc_order_set_dummyG_dummy1)
+    set dummy1 dummy-clone (id:order_set_d1dy_set) (id:order_set_d1dy)
+    set dummyG-clone dummy1 (id:order_set_dGd1_set) (id:order_set_dGd1)
 Colocation Constraints:
   dummy-clone with dummy1 (score:INFINITY) (id:colocation-dummy-clone-dummy1-INFINITY)
   dummy1 with dummyG-clone (score:INFINITY) (id:colocation-dummy1-dummyG-clone-INFINITY)
   Resource Sets:
-    set dummy1 dummy-clone (id:pcs_rsc_set_dummy1_dummy-clone-1) setoptions score=INFINITY (id:pcs_rsc_colocation_set_dummy1_dummy)
-    set dummy1 dummyG-clone (id:pcs_rsc_set_dummy1_dummyG-clone) setoptions score=INFINITY (id:pcs_rsc_colocation_set_dummy1_dummyG)
+    set dummy1 dummy-clone (id:colocation_set_d1dy_set) setoptions score=INFINITY (id:colocation_set_d1dy)
+    set dummy1 dummyG-clone (id:colocation_set_d1dG_set) setoptions score=INFINITY (id:colocation_set_d1dG)
 Ticket Constraints:
 """)
         self.assertEqual(0, returnVal)
@@ -1761,7 +1773,7 @@ Adding dummy-clone dummy1 (kind: Mandatory) (Options: first-action=start then-ac
         )
         ac(output, """\
 Error: duplicate constraint already exists, use --force to override
-  set dummy1 dummy-clone (id:pcs_rsc_set_dummy1_dummy-clone) (id:pcs_rsc_order_set_dummy1_dummy)
+  set dummy1 dummy-clone (id:order_set_d1dy_set) (id:order_set_d1dy)
 """)
         self.assertEqual(1, returnVal)
 
@@ -1770,7 +1782,7 @@ Error: duplicate constraint already exists, use --force to override
         )
         ac(output, console_report(
             "Warning: duplicate constraint already exists",
-            "  set dummy1 dummy-clone (id:pcs_rsc_set_dummy1_dummy-clone) (id:pcs_rsc_order_set_dummy1_dummy)",
+            "  set dummy1 dummy-clone (id:order_set_d1dy_set) (id:order_set_d1dy)",
         ))
         self.assertEqual(0, returnVal)
 
@@ -1794,7 +1806,7 @@ Error: duplicate constraint already exists, use --force to override
         )
         ac(output, """\
 Error: duplicate constraint already exists, use --force to override
-  set dummy1 dummy-clone (id:pcs_rsc_set_dummy1_dummy-clone-1) setoptions score=INFINITY (id:pcs_rsc_colocation_set_dummy1_dummy)
+  set dummy1 dummy-clone (id:colocation_set_d1dy_set) setoptions score=INFINITY (id:colocation_set_d1dy)
 """)
         self.assertEqual(1, returnVal)
 
@@ -1803,7 +1815,7 @@ Error: duplicate constraint already exists, use --force to override
         )
         ac(output, console_report(
             "Warning: duplicate constraint already exists",
-            "  set dummy1 dummy-clone (id:pcs_rsc_set_dummy1_dummy-clone-1) setoptions score=INFINITY (id:pcs_rsc_colocation_set_dummy1_dummy)",
+            "  set dummy1 dummy-clone (id:colocation_set_d1dy_set) setoptions score=INFINITY (id:colocation_set_d1dy)",
         ))
         self.assertEqual(0, returnVal)
 
@@ -1828,17 +1840,17 @@ Ordering Constraints:
   start dummy1 then start dummyG-clone (kind:Mandatory) (id:order-dummy1-dummyG-clone-mandatory)
   start dummy-clone then start dummy1 (kind:Mandatory) (id:order-dummy-clone-dummy1-mandatory-1)
   Resource Sets:
-    set dummy1 dummy-clone (id:pcs_rsc_set_dummy1_dummy-clone) (id:pcs_rsc_order_set_dummy1_dummy)
-    set dummyG-clone dummy1 (id:pcs_rsc_set_dummyG-clone_dummy1) (id:pcs_rsc_order_set_dummyG_dummy1)
-    set dummy1 dummy-clone (id:pcs_rsc_set_dummy1_dummy-clone-2) (id:pcs_rsc_order_set_dummy1_dummy-1)
+    set dummy1 dummy-clone (id:order_set_d1dy_set) (id:order_set_d1dy)
+    set dummyG-clone dummy1 (id:order_set_dGd1_set) (id:order_set_dGd1)
+    set dummy1 dummy-clone (id:order_set_d1dy-1_set) (id:order_set_d1dy-1)
 Colocation Constraints:
   dummy-clone with dummy1 (score:INFINITY) (id:colocation-dummy-clone-dummy1-INFINITY)
   dummy1 with dummyG-clone (score:INFINITY) (id:colocation-dummy1-dummyG-clone-INFINITY)
   dummy-clone with dummy1 (score:INFINITY) (id:colocation-dummy-clone-dummy1-INFINITY-1)
   Resource Sets:
-    set dummy1 dummy-clone (id:pcs_rsc_set_dummy1_dummy-clone-1) setoptions score=INFINITY (id:pcs_rsc_colocation_set_dummy1_dummy)
-    set dummy1 dummyG-clone (id:pcs_rsc_set_dummy1_dummyG-clone) setoptions score=INFINITY (id:pcs_rsc_colocation_set_dummy1_dummyG)
-    set dummy1 dummy-clone (id:pcs_rsc_set_dummy1_dummy-clone-3) setoptions score=INFINITY (id:pcs_rsc_colocation_set_dummy1_dummy-1)
+    set dummy1 dummy-clone (id:colocation_set_d1dy_set) setoptions score=INFINITY (id:colocation_set_d1dy)
+    set dummy1 dummyG-clone (id:colocation_set_d1dG_set) setoptions score=INFINITY (id:colocation_set_d1dG)
+    set dummy1 dummy-clone (id:colocation_set_d1dy-1_set) setoptions score=INFINITY (id:colocation_set_d1dy-1)
 Ticket Constraints:
 """)
         self.assertEqual(0, returnVal)
@@ -2420,14 +2432,14 @@ Ticket Constraints:
         output, returnVal = pcs("constraint order set D1 D2")
         ac(output, """\
 Error: duplicate constraint already exists, use --force to override
-  set D1 D2 (id:pcs_rsc_set_D1_D2) (id:pcs_rsc_order_set_D1_D2)
+  set D1 D2 (id:order_set_D1D2_set) (id:order_set_D1D2)
 """)
         self.assertEqual(1, returnVal)
 
         output, returnVal = pcs("constraint order set D1 D2 --force")
         ac(output, console_report(
             "Warning: duplicate constraint already exists",
-            "  set D1 D2 (id:pcs_rsc_set_D1_D2) (id:pcs_rsc_order_set_D1_D2)",
+            "  set D1 D2 (id:order_set_D1D2_set) (id:order_set_D1D2)",
         ))
         self.assertEqual(0, returnVal)
 
@@ -2438,14 +2450,14 @@ Error: duplicate constraint already exists, use --force to override
         output, returnVal = pcs("constraint order set D1 D2 set D5 D6")
         ac(output, """\
 Error: duplicate constraint already exists, use --force to override
-  set D1 D2 (id:pcs_rsc_set_D1_D2-2) set D5 D6 (id:pcs_rsc_set_D5_D6) (id:pcs_rsc_order_set_D1_D2_set_D5_D6)
+  set D1 D2 (id:order_set_D1D2D5_set) set D5 D6 (id:order_set_D1D2D5_set-1) (id:order_set_D1D2D5)
 """)
         self.assertEqual(1, returnVal)
 
         output, returnVal = pcs("constraint order set D1 D2 set D5 D6 --force")
         ac(output, console_report(
             "Warning: duplicate constraint already exists",
-            "  set D1 D2 (id:pcs_rsc_set_D1_D2-2) set D5 D6 (id:pcs_rsc_set_D5_D6) (id:pcs_rsc_order_set_D1_D2_set_D5_D6)",
+            "  set D1 D2 (id:order_set_D1D2D5_set) set D5 D6 (id:order_set_D1D2D5_set-1) (id:order_set_D1D2D5)",
         ))
         self.assertEqual(0, returnVal)
 
@@ -2457,14 +2469,14 @@ Error: duplicate constraint already exists, use --force to override
         output, returnVal = pcs("constraint colocation set D1 D2")
         ac(output, """\
 Error: duplicate constraint already exists, use --force to override
-  set D1 D2 (id:pcs_rsc_set_D1_D2-4) setoptions score=INFINITY (id:pcs_rsc_colocation_set_D1_D2)
+  set D1 D2 (id:colocation_set_D1D2_set) setoptions score=INFINITY (id:colocation_set_D1D2)
 """)
         self.assertEqual(1, returnVal)
 
         output, returnVal = pcs("constraint colocation set D1 D2 --force")
         ac(output, console_report(
             "Warning: duplicate constraint already exists",
-            "  set D1 D2 (id:pcs_rsc_set_D1_D2-4) setoptions score=INFINITY (id:pcs_rsc_colocation_set_D1_D2)"
+            "  set D1 D2 (id:colocation_set_D1D2_set) setoptions score=INFINITY (id:colocation_set_D1D2)"
         ))
         self.assertEqual(0, returnVal)
 
@@ -2475,7 +2487,7 @@ Error: duplicate constraint already exists, use --force to override
         output, returnVal = pcs("constraint colocation set D1 D2 set D5 D6")
         ac(output, """\
 Error: duplicate constraint already exists, use --force to override
-  set D1 D2 (id:pcs_rsc_set_D1_D2-6) set D5 D6 (id:pcs_rsc_set_D5_D6-2) setoptions score=INFINITY (id:pcs_rsc_colocation_set_D1_D2_set_D5_D6)
+  set D1 D2 (id:colocation_set_D1D2D5_set) set D5 D6 (id:colocation_set_D1D2D5_set-1) setoptions score=INFINITY (id:colocation_set_D1D2D5)
 """)
         self.assertEqual(1, returnVal)
 
@@ -2484,7 +2496,7 @@ Error: duplicate constraint already exists, use --force to override
         )
         ac(output, console_report(
             "Warning: duplicate constraint already exists",
-            "  set D1 D2 (id:pcs_rsc_set_D1_D2-6) set D5 D6 (id:pcs_rsc_set_D5_D6-2) setoptions score=INFINITY (id:pcs_rsc_colocation_set_D1_D2_set_D5_D6)"
+            "  set D1 D2 (id:colocation_set_D1D2D5_set) set D5 D6 (id:colocation_set_D1D2D5_set-1) setoptions score=INFINITY (id:colocation_set_D1D2D5)"
         ))
         self.assertEqual(0, returnVal)
 
@@ -2503,18 +2515,18 @@ Error: duplicate constraint already exists, use --force to override
 Location Constraints:
 Ordering Constraints:
   Resource Sets:
-    set D1 D2 (id:pcs_rsc_set_D1_D2) (id:pcs_rsc_order_set_D1_D2)
-    set D1 D2 (id:pcs_rsc_set_D1_D2-1) (id:pcs_rsc_order_set_D1_D2-1)
-    set D1 D2 (id:pcs_rsc_set_D1_D2-2) set D5 D6 (id:pcs_rsc_set_D5_D6) (id:pcs_rsc_order_set_D1_D2_set_D5_D6)
-    set D1 D2 (id:pcs_rsc_set_D1_D2-3) set D5 D6 (id:pcs_rsc_set_D5_D6-1) (id:pcs_rsc_order_set_D1_D2_set_D5_D6-1)
-    set D6 D1 (id:pcs_rsc_set_D6_D1-1) (id:pcs_rsc_order_set_D6_D1)
+    set D1 D2 (id:order_set_D1D2_set) (id:order_set_D1D2)
+    set D1 D2 (id:order_set_D1D2-1_set) (id:order_set_D1D2-1)
+    set D1 D2 (id:order_set_D1D2D5_set) set D5 D6 (id:order_set_D1D2D5_set-1) (id:order_set_D1D2D5)
+    set D1 D2 (id:order_set_D1D2D5-1_set) set D5 D6 (id:order_set_D1D2D5-1_set-1) (id:order_set_D1D2D5-1)
+    set D6 D1 (id:order_set_D6D1_set) (id:order_set_D6D1)
 Colocation Constraints:
   Resource Sets:
-    set D1 D2 (id:pcs_rsc_set_D1_D2-4) setoptions score=INFINITY (id:pcs_rsc_colocation_set_D1_D2)
-    set D1 D2 (id:pcs_rsc_set_D1_D2-5) setoptions score=INFINITY (id:pcs_rsc_colocation_set_D1_D2-1)
-    set D1 D2 (id:pcs_rsc_set_D1_D2-6) set D5 D6 (id:pcs_rsc_set_D5_D6-2) setoptions score=INFINITY (id:pcs_rsc_colocation_set_D1_D2_set_D5_D6)
-    set D1 D2 (id:pcs_rsc_set_D1_D2-7) set D5 D6 (id:pcs_rsc_set_D5_D6-3) setoptions score=INFINITY (id:pcs_rsc_colocation_set_D1_D2_set_D5_D6-1)
-    set D6 D1 (id:pcs_rsc_set_D6_D1) setoptions score=INFINITY (id:pcs_rsc_colocation_set_D6_D1)
+    set D1 D2 (id:colocation_set_D1D2_set) setoptions score=INFINITY (id:colocation_set_D1D2)
+    set D1 D2 (id:colocation_set_D1D2-1_set) setoptions score=INFINITY (id:colocation_set_D1D2-1)
+    set D1 D2 (id:colocation_set_D1D2D5_set) set D5 D6 (id:colocation_set_D1D2D5_set-1) setoptions score=INFINITY (id:colocation_set_D1D2D5)
+    set D1 D2 (id:colocation_set_D1D2D5-1_set) set D5 D6 (id:colocation_set_D1D2D5-1_set-1) setoptions score=INFINITY (id:colocation_set_D1D2D5-1)
+    set D6 D1 (id:colocation_set_D6D1_set) setoptions score=INFINITY (id:colocation_set_D6D1)
 Ticket Constraints:
 """)
 
@@ -2782,14 +2794,14 @@ Ordering Constraints:
   start D1 then start D2 (kind:Mandatory) (id:id7)
   start D2 then start D1 (kind:Optional) (id:id8)
   Resource Sets:
-    set D1 D2 (id:pcs_rsc_set_D1_D2-1) (id:id5)
-    set D2 D1 (id:pcs_rsc_set_D2_D1-1) setoptions kind=Mandatory (id:id6)
+    set D1 D2 (id:id5_set) (id:id5)
+    set D2 D1 (id:id6_set) setoptions kind=Mandatory (id:id6)
 Colocation Constraints:
   D1 with D2 (score:INFINITY) (id:id1)
   D2 with D1 (score:100) (id:id2)
   Resource Sets:
-    set D1 D2 (id:pcs_rsc_set_D1_D2) setoptions score=INFINITY (id:id3)
-    set D2 D1 (id:pcs_rsc_set_D2_D1) setoptions score=100 (id:id4)
+    set D1 D2 (id:id3_set) setoptions score=INFINITY (id:id3)
+    set D2 D1 (id:id4_set) setoptions score=100 (id:id4)
 Ticket Constraints:
 """)
         self.assertEqual(0, returnVal)
@@ -3527,10 +3539,8 @@ class BundleColocation(Bundle):
             "constraint colocation set B X",
             """
                 <constraints>
-                    <rsc_colocation id="pcs_rsc_colocation_set_B_X"
-                        score="INFINITY"
-                    >
-                        <resource_set id="pcs_rsc_set_B_X">
+                    <rsc_colocation id="colocation_set_BBXX" score="INFINITY">
+                        <resource_set id="colocation_set_BBXX_set">
                             <resource_ref id="B" />
                             <resource_ref id="X" />
                         </resource_set>
@@ -3553,10 +3563,8 @@ class BundleColocation(Bundle):
             "constraint colocation set R X --force",
             """
                 <constraints>
-                    <rsc_colocation id="pcs_rsc_colocation_set_R_X"
-                        score="INFINITY"
-                    >
-                        <resource_set id="pcs_rsc_set_R_X">
+                    <rsc_colocation id="colocation_set_RRXX" score="INFINITY">
+                        <resource_set id="colocation_set_RRXX_set">
                             <resource_ref id="R" />
                             <resource_ref id="X" />
                         </resource_set>
@@ -3615,8 +3623,8 @@ class BundleOrder(Bundle):
             "constraint order set B X",
             """
                 <constraints>
-                    <rsc_order id="pcs_rsc_order_set_B_X">
-                        <resource_set id="pcs_rsc_set_B_X">
+                    <rsc_order id="order_set_BBXX">
+                        <resource_set id="order_set_BBXX_set">
                             <resource_ref id="B" />
                             <resource_ref id="X" />
                         </resource_set>
@@ -3639,8 +3647,8 @@ class BundleOrder(Bundle):
             "constraint order set R X --force",
             """
                 <constraints>
-                    <rsc_order id="pcs_rsc_order_set_R_X">
-                        <resource_set id="pcs_rsc_set_R_X">
+                    <rsc_order id="order_set_RRXX">
+                        <resource_set id="order_set_RRXX_set">
                             <resource_ref id="R" />
                             <resource_ref id="X" />
                         </resource_set>
@@ -3693,8 +3701,8 @@ class BundleTicket(Bundle):
             "constraint ticket set B setoptions ticket=T",
             """
                 <constraints>
-                    <rsc_ticket id="pcs_rsc_ticket_set_B" ticket="T">
-                        <resource_set id="pcs_rsc_set_B">
+                    <rsc_ticket id="ticket_set_BB" ticket="T">
+                        <resource_set id="ticket_set_BB_set">
                             <resource_ref id="B" />
                         </resource_set>
                     </rsc_ticket>
@@ -3716,8 +3724,8 @@ class BundleTicket(Bundle):
             "constraint ticket set R setoptions ticket=T --force",
             """
                 <constraints>
-                    <rsc_ticket id="pcs_rsc_ticket_set_R" ticket="T">
-                        <resource_set id="pcs_rsc_set_R">
+                    <rsc_ticket id="ticket_set_RR" ticket="T">
+                        <resource_set id="ticket_set_RR_set">
                             <resource_ref id="R" />
                         </resource_set>
                     </rsc_ticket>
-- 
2.21.0