From mboxrd@z Thu Jan 1 00:00:00 1970 From: kupcevic@sourceware.org Date: 10 Oct 2006 21:33:30 -0000 Subject: [Cluster-devel] conga/luci/site/luci/Extensions cluster_adapte ... Message-ID: <20061010213330.8471.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: conga Changes by: kupcevic at sourceware.org 2006-10-10 21:33:29 Modified files: luci/site/luci/Extensions: cluster_adapters.py ricci_bridge.py Log message: luci: backend support for selection of what to install during deployment Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.87&r2=1.88 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_bridge.py.diff?cvsroot=cluster&r1=1.22&r2=1.23 --- conga/luci/site/luci/Extensions/cluster_adapters.py 2006/10/09 20:21:58 1.87 +++ conga/luci/site/luci/Extensions/cluster_adapters.py 2006/10/10 21:33:29 1.88 @@ -158,7 +158,14 @@ return (False, {'errors': errors, 'requestResults':cluster_properties }) if cluster_properties['isComplete'] == True: - batchNode = createClusterBatch(cluster_os, clusterName, clusterName, map(lambda x: x['ricci_host'], nodeList), True, False, False) + batchNode = createClusterBatch(cluster_os, + clusterName, + clusterName, + map(lambda x: x['ricci_host'], nodeList), + True, + True, + False, + False) if not batchNode: nodeUnauth(nodeList) cluster_properties['isComplete'] = False @@ -250,7 +257,11 @@ while i < len(nodeList): clunode = nodeList[i] try: - batchNode = addClusterNodeBatch(clusterName, True, False, False) + batchNode = addClusterNodeBatch(clusterName, + True, + True, + False, + False) if not batchNode: raise del nodeList[i] --- conga/luci/site/luci/Extensions/ricci_bridge.py 2006/10/09 20:17:29 1.22 +++ conga/luci/site/luci/Extensions/ricci_bridge.py 2006/10/10 21:33:29 1.23 @@ -635,31 +635,49 @@ #parse out log entry return payload -def addClusterNodeBatch(cluster_name, services, shared_storage, LVS): +def addClusterNodeBatch(cluster_name, + install_base, + install_services, + install_shared_storage, + install_LVS): batch = '' batch += '' + + batch += '' batch += '' batch += '' batch += '' - batch += '' - if services: - batch += '' - if shared_storage: - batch += '' - if LVS: - batch += '' + if install_base: + batch += '' + if install_services: + batch += '' + if install_shared_storage: + batch += '' + if install_LVS: + batch += '' batch += '' batch += '' batch += '' batch += '' - - batch += '' - batch += '' - batch += '' - batch += '' - batch += '' - + + + need_reboot = install_base or install_services or install_shared_storage or install_LVS + if need_reboot: + batch += '' + batch += '' + batch += '' + batch += '' + batch += '' + else: + # need placeholder instead of reboot + batch += '' + batch += '' + batch += '' + batch += '' + batch += '' + + batch += '' batch += '' batch += '' @@ -676,45 +694,65 @@ batch += '' batch += '' batch += '' - + + batch += '' batch += '' batch += '' batch += '' batch += '' + + batch += '' return minidom.parseString(batch).firstChild -def createClusterBatch(os_str, cluster_name, cluster_alias, nodeList, services, shared_storage, LVS): +def createClusterBatch(os_str, + cluster_name, + cluster_alias, + nodeList, + install_base, + install_services, + install_shared_storage, + install_LVS): batch = '' batch += '' + + batch += '' batch += '' batch += '' batch += '' - batch += '' - - if services: - batch += '' - - if shared_storage: - batch += '' - - if LVS: - batch += '' - + if install_base: + batch += '' + if install_services: + batch += '' + if install_shared_storage: + batch += '' + if install_LVS: + batch += '' batch += '' batch += '' batch += '' batch += '' - batch += '' - batch += '' - batch += '' - batch += '' - batch += '' + need_reboot = install_base or install_services or install_shared_storage or install_LVS + if need_reboot: + batch += '' + batch += '' + batch += '' + batch += '' + batch += '' + else: + # need placeholder instead of reboot + batch += '' + batch += '' + batch += '' + batch += '' + batch += '' + + batch += '' batch += '' batch += '' @@ -747,6 +785,7 @@ batch += '' batch += '' + batch += '' batch += '' batch += '' @@ -754,7 +793,9 @@ batch += '' batch += '' batch += '' + + batch += '' - + return minidom.parseString(batch).firstChild