conga luci/site/luci/Extensions/HelperFunction ...
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2008-01-15 04:41:41
Modified files:
luci/site/luci/Extensions: HelperFunctions.py LuciClusterInfo.py
LuciValidation.py LuciZopeExternal.py homebase_adapters.py
luci/site/luci/Extensions/ClusterModel: ModelBuilder.py
luci/cluster : cluster_svc-macros
. : Makefile clustermon.spec.in.in conga.spec.in.in
Log message:
Fix bz383071 (Virtual machine configuration - add field for "migration type" xml attr = "migrate")
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/HelperFunctions.py.diff?cvsroot=cluster&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciClusterInfo.py.diff?cvsroot=cluster&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciValidation.py.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZopeExternal.py.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/homebase_adapters.py.diff?cvsroot=cluster&r1=1.54&r2=1.55
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py.diff?cvsroot=cluster&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/cluster_svc-macros.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/Makefile.diff?cvsroot=cluster&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/clustermon.spec.in.in.diff?cvsroot=cluster&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&r1=1.92&r2=1.93
luci/site/luci/Extensions/HelperFunctions.py +2 -1
@@ -9,7 +9,8 @@ import threading def resolveOSType(os_str): - if not os_str or os_str.find('Tikanga') != (-1) or os_str.find('FC6') != (-1) or os_str.find('Zod') != (-1) or os_str.find('Moonshine') != (-1): + rhel5_clu_ver = [ 'Tikanga', 'Zod', 'Moonshine', 'Werewolf' ] + if not os_str or os_str in rhel5_clu_ver: return 'rhel5' else: return 'rhel4'
luci/site/luci/Extensions/LuciClusterInfo.py +19 -1
@@ -575,6 +575,15 @@ return {} clumap = {} + try: + cluster_os = model.getClusterOS() + if cluster_os.find('Tikanga'): + os_minor = int(cluster_os[cluster_os.find('5.') + 2]) + if os_minor > 1: + clumap['vm_migration_choice'] = True + except: + pass + if not model: try: model = getModelForCluster(self, cluname)
@@ -1487,6 +1496,15 @@ luci_log.debug_verbose('getVMInfo0: no service name') return vm_map + try: + cluster_os = model.getClusterOS() + if cluster_os.find('Tikanga'): + os_minor = int(cluster_os[cluster_os.find('5.') + 2]) + if os_minor > 1: + vm_map['vm_migration_choice'] = True + except: + pass + vm_map['formurl'] = '%s?clustername=%s&pagetype=29&servicename=%s' \ % (baseurl, clustername, svcname)
@@ -1537,7 +1555,7 @@ return None try: - model = ModelBuilder(0, None, None, cluster_conf_node) + model = ModelBuilder(None, cluster_conf_node, rc.os()) if not model: raise Exception, 'ModelBuilder() returned None' model.setIsVirtualized(isVirtualized)
luci/site/luci/Extensions/LuciValidation.py +7 -1
@@ -1062,7 +1062,7 @@ def validate_vmsvc_form(model, request): errors = list() - fvar = GetReqVars(request, [ 'vmname', 'oldname', 'vmpath', 'recovery', 'domain', ]) + fvar = GetReqVars(request, [ 'vmname', 'oldname', 'vmpath', 'recovery', 'domain', 'migration_type']) vm_name = fvar['vmname'] if vm_name is None:
@@ -1092,6 +1092,10 @@ if recovery is not None and recovery != 'restart' and recovery != 'relocate' and recovery != 'disable': errors.append('You entered an invalid recovery option "%s" for VM service "%s". Valid options are "restart" "relocate" and "disable"' % (recovery, vm_name)) + migration_type = fvar['migration_type'] + if migration_type is not None and migration_type != 'live' and migration_type != 'pause': + errors.append('Migration type must be either "live" or "pause"') + if len(errors) > 0: return (False, {'errors': errors })
@@ -1130,6 +1134,8 @@ xvm.addAttribute('autostart', str(autostart)) xvm.addAttribute('exclusive', str(exclusive)) + if migration_type: + xvm.addAttribute('migrate', str(migration_type)) fdom = fvar['domain'] if fdom:
luci/site/luci/Extensions/LuciZopeExternal.py +2 -2
@@ -14,8 +14,8 @@ getDefaultUser from cluster_adapters import clusterTaskProcess, \ - resourceDelete, serviceDelete, \ - isClusterBusy, nodeTaskProcess, process_cluster_conf_editor, \ + resourceDelete, serviceDelete, isClusterBusy, nodeTaskProcess, \ + process_cluster_conf_editor, \ serviceMigrate, serviceRestart, serviceStart, serviceStop, \ getResourceInfo, getSystemLogs
luci/site/luci/Extensions/homebase_adapters.py +1 -1
@@ -201,7 +201,7 @@ try: cur_host_trusted = request.form.has_key('host_is_trusted') except: - cur_host_trusted = False + cur_host_trusted = not check_certs trust_shown = False try:
luci/site/luci/Extensions/ClusterModel/ModelBuilder.py +19 -35
78 lines not on this page · raw message
luci/cluster/cluster_svc-macros +31 -0
@@ -140,6 +140,8 @@ </div> <div metal:define-macro="vmadd-form"> + <tal:block tal:define=" + global clusterinfo python: here.getClusterInfo(modelb, request)" /> <form method="post" action=""> <input type="hidden" name="clustername" tal:attributes="value request/clustername | nothing" />
@@ -178,6 +180,7 @@ </select> </td> </tr> + <tr class="systemsTable"> <td>Recovery policy</td> <td>
@@ -189,6 +192,19 @@ </select> </td> </tr> + + <tr class="systemsTable" + tal:condition="exists:clusterinfo/vm_migration_choice"> + + <td>Migration type</td> + <td> + <select name="migration_type"> + <option value="live" selected="selected">Live</option> + <option value="pause">Pause</option> + </select> + </td> + </tr> + <tr class="systemsTable"><td colspan="2"> <div class="hbSubmit"> <input type="submit" value="Create Virtual Machine Service" />
@@ -343,6 +359,21 @@ </select> </td> </tr> + + <tr class="systemsTable" + tal:condition="exists:vminfo/vm_migration_choice"> + + <td>Migration type</td> + <td> + <select name="migration_type"> + <option value="live" tal:content="string:Live" + tal:attributes="selected python:('migrate' not in vminfo or vminfo['migrate'] != 'pause') and 'selected' or ''" /> + <option value="pause" tal:content="string:Pause" + tal:attributes="selected python:('migrate' in vminfo and vminfo['migrate'] == 'pause') and 'selected' or ''" /> + </select> + </td> + </tr> + <tr class="systemsTable"><td colspan="2"> <div class="hbSubmit"> <input name="submit" type="submit" value="Update Virtual Machine Service" />
Makefile +1 -1
@@ -1,6 +1,6 @@ ################################################################################ ## -## Copyright (C) 2005-2007 Red Hat, Inc. All rights reserved. +## Copyright (C) 2005-2008 Red Hat, Inc. All rights reserved. ## ## This copyrighted material is made available to anyone wishing to use, ## modify, copy, or redistribute it subject to the terms and conditions
clustermon.spec.in.in +1 -1
@@ -1,6 +1,6 @@ ############################################################################## # -# Copyright (C) 2006-2007 Red Hat, Inc. All rights reserved. +# Copyright (C) 2006-2008 Red Hat, Inc. All rights reserved. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions
conga.spec.in.in +1 -0
@@ -303,6 +303,7 @@ - Fixed bz337041 (Add option to not fail-back service) - Fixed bz264161 (RFE: support setting the "__independent_subtree" attribute on cluster resources) - Fixed bz239387 (RFE: add timeouts for actions that can leave cluster unreachable) +- Fixed bz383071 (Virtual machine configuration - add field for "migration type" xml attr = "migrate") * Mon Aug 27 2007 Ryan McCabe <[email protected]> 0.10.0-6 - Fixed bz253783