Blame SOURCES/bz1170150-Fix-displaying-globally-unique-clones-in-GUI.patch

337c54
From af67ec81f2276e58795da944c1352b62356cc051 Mon Sep 17 00:00:00 2001
337c54
From: Tomas Jelinek <tojeline@redhat.com>
337c54
Date: Mon, 1 Dec 2014 11:46:11 +0100
337c54
Subject: [PATCH] Fix displaying globally-unique clones in GUI
337c54
337c54
---
337c54
 pcsd/resource.rb | 7 +++++--
337c54
 1 file changed, 5 insertions(+), 2 deletions(-)
337c54
337c54
diff --git a/pcsd/resource.rb b/pcsd/resource.rb
337c54
index 387e791..1577e58 100644
337c54
--- a/pcsd/resource.rb
337c54
+++ b/pcsd/resource.rb
337c54
@@ -359,19 +359,22 @@ class Resource
337c54
     :options, :group, :clone, :stonith, :ms, :operations,
337c54
     :instance_attr, :meta_attr, :clone_id, :ms_id
337c54
   def initialize(e, group = nil, clone = false, ms = false)
337c54
-    @id = e.attributes["id"]
337c54
+    # Strip ':' from resource name (for clones & master/slave)
337c54
+    @id = e.attributes["id"].sub(/(.*):.*/, '\1')
337c54
     @agentname = e.attributes["resource_agent"]
337c54
     @active = e.attributes["active"] == "true" ? true : false
337c54
     @orphaned = e.attributes["orphaned"] == "true" ? true : false
337c54
     @failed = e.attributes["failed"] == "true" ? true : false
337c54
     @active = e.attributes["active"] == "true" ? true : false
337c54
     @nodes = []
337c54
-    @group = group
337c54
+    # Strip ':' from group name (for clones & master/slave created from a group)
337c54
+    @group = group ? group.sub(/(.*):.*/, '\1') : group
337c54
     @clone = clone
337c54
     @ms = ms
337c54
     @clone_id = nil
337c54
     @ms_id = nil
337c54
     @stonith = false
337c54
+    @options = {}
337c54
     @instance_attr = {}
337c54
     @meta_attr = {}
337c54
     @operations = {}
337c54
-- 
337c54
1.9.1
337c54