[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] conga/luci cluster/form-macros site/luci/Exten ...



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe sourceware org	2007-01-06 03:29:17

Modified files:
	luci/cluster   : form-macros 
	luci/site/luci/Extensions: cluster_adapters.py 

Log message:
	support preserving entries in cluster.conf for custom fence agents

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.142&r2=1.143
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.194&r2=1.195

--- conga/luci/cluster/form-macros	2007/01/05 23:44:10	1.142
+++ conga/luci/cluster/form-macros	2007/01/06 03:29:16	1.143
@@ -1204,6 +1204,31 @@
 	<option name="fence_manual" value="fence_manual">Manual Fencing</option>
 </div>
 
+<div metal:define-macro="fence-form-unknown"
+	tal:attributes="id cur_fencedev/name | nothing">
+
+	<div id="fence_unknown" class="fencedev">
+		<table>
+			<tr>
+				<td><strong class="cluster">Fence Type</strong></td>
+				<td>[unknown]</td>
+			</tr>
+			<tr>
+				<td>Name</td>
+				<td>
+					<span tal:replace="cur_fencedev/name | nothing" />
+				</td>
+			</tr>
+		</table>
+
+		<tal:block tal:condition="exists: cur_fencedev">
+			<input type="hidden" name="existing_device" value="1" />
+			<input type="hidden" name="old_name"
+				tal:attributes="value cur_fencedev/name | nothing" />
+		</tal:block>
+	</div>
+</div>
+
 <div metal:define-macro="fence-form-apc"
 	tal:attributes="id cur_fencedev/name | nothing">
 
@@ -4020,6 +4045,10 @@
 	<tal:block tal:condition="python: cur_fence_type == 'fence_manual'">
 		<tal:block metal:use-macro="here/form-macros/macros/fence-form-manual" />
 	</tal:block>
+
+    <tal:block tal:condition="exists:cur_fencedev/unknown">
+		<tal:block metal:use-macro="here/form-macros/macros/fence-form-unknown" />
+	</tal:block>
 </div>
 
 
--- conga/luci/site/luci/Extensions/cluster_adapters.py	2007/01/05 23:44:10	1.194
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2007/01/06 03:29:16	1.195
@@ -3968,6 +3968,7 @@
       try:
         map['pretty_name'] = FENCE_OPTS[fencedev.getAgentType()]
       except:
+        map['unknown'] = True
         map['pretty_name'] = fencedev.getAgentType()
 
       nodes_used = list()
@@ -4082,7 +4083,11 @@
       if fd is not None:
         if fd.isShared() == False:  #Not a shared dev...build struct and add
           fencedev = {}
-          fencedev['prettyname'] = FENCE_OPTS[fd.getAgentType()]
+          try:
+            fencedev['prettyname'] = FENCE_OPTS[fd.getAgentType()]
+          except:
+            fencedev['unknown'] = True
+            fencedev['prettyname'] = fd.getAgentType()
           fencedev['isShared'] = False
           fencedev['id'] = str(major_num)
           major_num = major_num + 1
@@ -4119,7 +4124,11 @@
             continue
           else: #Shared, but not used above...so we need a new fencedev struct
             fencedev = {}
-            fencedev['prettyname'] = FENCE_OPTS[fd.getAgentType()]
+            try:
+              fencedev['prettyname'] = FENCE_OPTS[fd.getAgentType()]
+            except:
+              fencedev['unknown'] = True
+              fencedev['prettyname'] = fd.getAgentType()
             fencedev['isShared'] = True
             fencedev['cfgurl'] = baseurl + "?clustername=" + clustername + "&fencename=" + fd.getName().strip() + "&pagetype=" + FENCEDEV 
             fencedev['id'] = str(major_num)
@@ -4157,7 +4166,11 @@
         shared_struct['name'] = fd.getName().strip()
         agentname = fd.getAgentType()
         shared_struct['agent'] = agentname
-        shared_struct['prettyname'] = FENCE_OPTS[agentname]
+        try:
+          shared_struct['prettyname'] = FENCE_OPTS[agentname]
+        except:
+          shared_struct['unknown'] = True
+          shared_struct['prettyname'] = agentname
         shared1.append(shared_struct)
     map['shared1'] = shared1
 
@@ -4177,7 +4190,11 @@
       if fd is not None:
         if fd.isShared() == False:  #Not a shared dev...build struct and add
           fencedev = {}
-          fencedev['prettyname'] = FENCE_OPTS[fd.getAgentType()]
+          try:
+            fencedev['prettyname'] = FENCE_OPTS[fd.getAgentType()]
+          except:
+            fencedev['unknown'] = True
+            fencedev['prettyname'] = fd.getAgentType()
           fencedev['isShared'] = False
           fencedev['id'] = str(major_num)
           major_num = major_num + 1
@@ -4214,7 +4231,11 @@
             continue
           else: #Shared, but not used above...so we need a new fencedev struct
             fencedev = {}
-            fencedev['prettyname'] = FENCE_OPTS[fd.getAgentType()]
+            try:
+              fencedev['prettyname'] = FENCE_OPTS[fd.getAgentType()]
+            except:
+              fencedev['unknown'] = True
+              fencedev['prettyname'] = fd.getAgentType()
             fencedev['isShared'] = True
             fencedev['cfgurl'] = baseurl + "?clustername=" + clustername + "&fencename=" + fd.getName().strip() + "&pagetype=" + FENCEDEV 
             fencedev['id'] = str(major_num)
@@ -4252,7 +4273,11 @@
         shared_struct['name'] = fd.getName().strip()
         agentname = fd.getAgentType()
         shared_struct['agent'] = agentname
-        shared_struct['prettyname'] = FENCE_OPTS[agentname]
+        try:
+          shared_struct['prettyname'] = FENCE_OPTS[agentname]
+        except:
+          shared_struct['unknown'] = True
+          shared_struct['prettyname'] = agentname
         shared2.append(shared_struct)
     map['shared2'] = shared2
 
@@ -4283,6 +4308,7 @@
       try:
         fencedev['pretty_name'] = FENCE_OPTS[fd.getAgentType()]
       except:
+        fencedev['unknown'] = True
         fencedev['pretty_name'] = fd.getAgentType()
       fencedev['agent'] = fd.getAgentType()
       #Add config url for this fencedev


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]