Blob Blame History Raw
From af67ec81f2276e58795da944c1352b62356cc051 Mon Sep 17 00:00:00 2001
From: Tomas Jelinek <tojeline@redhat.com>
Date: Mon, 1 Dec 2014 11:46:11 +0100
Subject: [PATCH] Fix displaying globally-unique clones in GUI

---
 pcsd/resource.rb | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/pcsd/resource.rb b/pcsd/resource.rb
index 387e791..1577e58 100644
--- a/pcsd/resource.rb
+++ b/pcsd/resource.rb
@@ -359,19 +359,22 @@ class Resource
     :options, :group, :clone, :stonith, :ms, :operations,
     :instance_attr, :meta_attr, :clone_id, :ms_id
   def initialize(e, group = nil, clone = false, ms = false)
-    @id = e.attributes["id"]
+    # Strip ':' from resource name (for clones & master/slave)
+    @id = e.attributes["id"].sub(/(.*):.*/, '\1')
     @agentname = e.attributes["resource_agent"]
     @active = e.attributes["active"] == "true" ? true : false
     @orphaned = e.attributes["orphaned"] == "true" ? true : false
     @failed = e.attributes["failed"] == "true" ? true : false
     @active = e.attributes["active"] == "true" ? true : false
     @nodes = []
-    @group = group
+    # Strip ':' from group name (for clones & master/slave created from a group)
+    @group = group ? group.sub(/(.*):.*/, '\1') : group
     @clone = clone
     @ms = ms
     @clone_id = nil
     @ms_id = nil
     @stonith = false
+    @options = {}
     @instance_attr = {}
     @meta_attr = {}
     @operations = {}
-- 
1.9.1