* [Cluster-devel] conga/luci homebase/luci_homebase.css site/luc ...
@ 2007-01-10 16:00 rmccabe
0 siblings, 0 replies; 2+ messages in thread
From: rmccabe @ 2007-01-10 16:00 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2007-01-10 16:00:42
Modified files:
luci/homebase : luci_homebase.css
luci/site/luci/Extensions: cluster_adapters.py
Log message:
node fence updates
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/luci_homebase.css.diff?cvsroot=cluster&r1=1.32&r2=1.33
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.195&r2=1.196
--- conga/luci/homebase/luci_homebase.css 2007/01/08 21:58:33 1.32
+++ conga/luci/homebase/luci_homebase.css 2007/01/10 16:00:41 1.33
@@ -14,6 +14,10 @@
background: #dee7ec;
}
+input.pad_left {
+ margin-left: +.3333em;
+}
+
div.fence {
max-width: 700px;
padding: .5em;
--- conga/luci/site/luci/Extensions/cluster_adapters.py 2007/01/06 03:29:16 1.195
+++ conga/luci/site/luci/Extensions/cluster_adapters.py 2007/01/10 16:00:42 1.196
@@ -23,6 +23,9 @@
from QuorumD import QuorumD
from Heuristic import Heuristic
from clusterOS import resolveOSType
+from Method import Method
+from FenceDevice import FenceDevice
+from Device import Device
from FenceHandler import validateNewFenceDevice, FENCE_OPTS, validateFenceDevice
from GeneralError import GeneralError
from homebase_adapters import manageCluster, createClusterSystems, havePermCreateCluster, setNodeFlag, delNodeFlag, userAuthenticated, getStorageNode, getClusterNode, delCluster, parseHostForm
@@ -1443,14 +1446,54 @@
return (False, {'errors': ['No fence data was supplied.']})
try:
+ fence_level = int(request.form['fence_level'].strip())
+ except Exception, e:
+ luci_log.debug_verbose('vNFC0a: no fence level: %s' % str(e))
+ return (False, {'errors': ['No fence level was supplied.']})
+
+ try:
+ nodename = request['nodename']
+ if not nodename:
+ raise Exception, 'nodename is blank'
+ except Exception, e:
+ luci_log.debug_verbose('vNFC1: no nodename: %s' % str(e))
+ return (False, {'errors': ['No node name was given.']})
+
+ try:
+ clustername = request['clustername']
+ if not clustername:
+ raise Exception, 'clustername is blank'
+ except Exception, e:
+ luci_log.debug_verbose('vNFC2: no clustername: %s' % str(e))
+ return (False, {'errors': ['No cluster name was given.']})
+
+ try:
+ model = request.SESSION.get('model')
+ if not model:
+ raise Exception, 'model is none'
+ except Exception, e:
+ model = None
+ try:
+ model = getModelForCluster(self, clustername)
+ except:
+ model = None
+
+ if model is None:
+ luci_log.debug_verbose('vNFC2a: unable to get model for cluster %s' % clustername)
+ return (False, {'errors': ['No cluster model was found.']})
+
+ try:
doc = minidom.parseString(form_xml)
forms = doc.getElementsByTagName('form')
if len(forms) < 1:
raise
except Exception, e:
- luci_log.debug_verbose('vNFC1: error: %s' % str(e))
+ luci_log.debug_verbose('vNFC2b: error: %s' % str(e))
return (False, {'errors': ['The fence data submitted is not properly formed.']})
+ fence_method = Method()
+ fence_method.addAttribute('name', str(fence_level))
+
form_hash = {}
for i in forms:
form_id = i.getAttribute('name')
@@ -1465,19 +1508,126 @@
for i in ielems:
try:
input_type = str(i.getAttribute('type'))
- except:
+ except Exception, e:
+ luci_log.debug_verbose('vNFC4: input type: %s' % str(e))
continue
+
if not input_type or input_type == 'button':
continue
+
try:
dummy_form[str(i.getAttribute('name'))] = str(i.getAttribute('value'))
except Exception, e:
- luci_log.debug_verbose('vNFC2: parsing XML: %s' % str(e))
+ luci_log.debug_verbose('vNFC5: parsing XML: %s' % str(e))
+
+ if len(dummy_form) < 1:
+ continue
+
+ if 'instance' in dummy_form:
+ try:
+ parent = dummy_form['parent_fencedev']
+ parent_form = form_hash[parent][1].append(dummy_form)
+ except:
+ luci_log.debug_verbose('vNFC6: no parent for instance: %s' \
+ % dummy_form['name'])
+ raise Exception, 'instance has no owner'
+ else:
+ form_hash[form_id] = (dummy_form, list())
+
+ for i in form_hash:
+ fencedev_name = None
+ fencedev_unknown = False
+ fencedev_obj = None
+
+ try:
+ fence_form, instance_list = form_hash[i]
+ except Exception, e:
+ luci_log.debug_verbose('vNFC7: %s' % str(e))
+ continue
+
+ try:
+ fence_type = fence_form['fence_type']
+ if not fence_type:
+ raise Exception, 'fence type is blank'
+ fence_form['agent'] = fence_type
+ except Exception, e:
+ luci_log.debug_verbose('vNFC8: %s' % str(e))
+ fence_type = None
+
+ try:
+ del fence_form['fence_type']
+ except:
+ pass
+
+ fencedev_name = fence_form['name']
+ if 'existing_device' in fence_form:
+ del fence_form['existing_device']
+
+ if fence_type is None:
+ # An unknown device. Pull the data out of
+ # the model and persist it and all instances.
+ # All we care about is its name.
+ fencedev_unknown = True
+ else:
+ if 'sharable' in fence_form:
+ # If it's a shared fence device that already exists, the
+ # user could not have edited it (without playing dirty
+ # games), so it's safe to pull the existing entry from
+ # the model. All we need is the device name.
+ pass
+ else:
+ # An existing non-shared device; build up the device
+ # from scratch since the user could have edited it.
+ try:
+ old_name = fence_form['old_name']
+ if not old_name:
+ raise Exception, 'old name is blank'
+ del fence_form['old_name']
+ except Exception, e:
+ luci_log.debug_verbose('vNFC8: no old name for %s %s' \
+ % (fence_form['name'], str(e)))
+
+ fencedev_obj = FenceDevice()
+ for k in fence_form.keys():
+ fencedev_obj.addAttribute(k, fence_form[k])
+ else:
+ # The user created a new fence device.
+ fencedev_name = fence_form['name']
+ fencedev_obj = FenceDevice()
+ for k in fence_form.keys():
+ fencedev_obj.addAttribute(k, fence_form[k])
+
+ if fencedev_obj is not None:
+ # If a device with this name exists in the model
+ # already, replace it with the current object. If
+ # this block is not executed, we don't need to make
+ # any changes to the fencedevices block for this
+ # device
+ pass
+
+ if fencedev_unknown is True:
+ # Save any instances for this fence device.
+ pass
+
+ for inst in instance_list:
+ new_instance = not 'existing_instance' in inst
+ try:
+ del inst['new_instance']
+ del inst['parent_fencedev']
+ del inst['existing_instance']
+ del inst['name']
+ except:
pass
- form_hash[form_id] = dummy_form
- luci_log.debug_verbose('vNFC3: got xml: %s' % doc.toxml())
- return (False, { 'errors': [ doc.toxml() ]})
+ device_obj = Device()
+ device_obj.setAgentType(fence_type)
+ device_obj.addAttribute('name', fencedev_name)
+ for k in new_instance.keys():
+ device_obj.addAttribute(k, inst[k])
+ fence_method.addChild(device_obj)
+
+ luci_log.debug_verbose('vNFC7: got xml: %s' % doc.toprettyxml())
+ return (False, { 'errors': [ doc.toprettyxml() ]})
def deleteFenceDevice(self, request):
errors = list()
^ permalink raw reply [flat|nested] 2+ messages in thread* [Cluster-devel] conga/luci homebase/luci_homebase.css site/luc ...
@ 2007-06-28 16:02 rmccabe
0 siblings, 0 replies; 2+ messages in thread
From: rmccabe @ 2007-06-28 16:02 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2007-06-28 16:02:50
Modified files:
luci/homebase : luci_homebase.css
luci/site/luci/Extensions: LuciDB.py
Added files:
luci/plone-custom: sys_svc.css
luci/site/luci/Extensions/ClusterModel: .cvsignore
Log message:
move system service control css out of the cluster area
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/luci_homebase.css.diff?cvsroot=cluster&r1=1.40&r2=1.41
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/sys_svc.css.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciDB.py.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/.cvsignore.diff?cvsroot=cluster&r1=1.1&r2=1.2
--- conga/luci/homebase/luci_homebase.css 2007/02/23 22:07:45 1.40
+++ conga/luci/homebase/luci_homebase.css 2007/06/28 16:02:50 1.41
@@ -8,60 +8,6 @@
font-size: 12px;
}
-input[type=image] {
- border: 0;
- background: transparent;
- padding-left: +.3333em;
- padding-right: +.3333em;
-}
-
-input[type=image]:disabled {
- cursor: url('cursor-disabled.png'), default;
-}
-
-input.svc_control {
- color: transparent ! important;
- border: none ! important;
- outline: hidden ! important;
- background-color: transparent ! important;
- background-repeat: no-repeat ! important;
- cursor: pointer;
-}
-
-.svc_control_start {
- background-image: url(svc_start.png);
-}
-
-input.svc_control_start:hover, input.svc_control_start:active {
- background-image: url(svc_start_active.png) ! important;
-}
-input.svc_control_start:disabled {
- background-image: url(svc_start_disabled.png) ! important;
- cursor: url('cursor-disabled.png'), default;
-}
-
-input.svc_control_restart {
- background-image: url(svc_reload.png);
-}
-input.svc_control_restart:hover, input.svc_control_restart:active {
- background-image: url(svc_reload_active.png) ! important;
-}
-input.svc_control_restart:disabled {
- background-image: url(svc_reload_disabled.png) ! important;
- cursor: url('cursor-disabled.png'), default;
-}
-
-input.svc_control_stop {
- background-image: url(svc_stop.png);
-}
-input.svc_control_stop:hover, input.svc_control_stop:active {
- background-image: url(svc_stop_active.png) ! important;
-}
-input.svc_control_stop:disabled {
- background-image: url(svc_stop_disabled.png) ! important;
- cursor: url('cursor-disabled.png'), default;
-}
-
input[type=checkbox], input[type=radio] {
float: left ! important;
vertical-align: middle;
/cvs/cluster/conga/luci/plone-custom/sys_svc.css,v --> standard output
revision 1.1
--- conga/luci/plone-custom/sys_svc.css
+++ - 2007-06-28 16:02:51.173560000 +0000
@@ -0,0 +1,53 @@
+input[type=image] {
+ border: 0;
+ background: transparent;
+ padding-left: +.3333em;
+ padding-right: +.3333em;
+}
+
+input[type=image]:disabled {
+ cursor: url('cursor-disabled.png'), default;
+}
+
+input.svc_control {
+ color: transparent ! important;
+ border: none ! important;
+ outline: hidden ! important;
+ background-color: transparent ! important;
+ background-repeat: no-repeat ! important;
+ cursor: pointer;
+}
+
+.svc_control_start {
+ background-image: url(svc_start.png);
+}
+
+input.svc_control_start:hover, input.svc_control_start:active {
+ background-image: url(svc_start_active.png) ! important;
+}
+input.svc_control_start:disabled {
+ background-image: url(svc_start_disabled.png) ! important;
+ cursor: url('cursor-disabled.png'), default;
+}
+
+input.svc_control_restart {
+ background-image: url(svc_reload.png);
+}
+input.svc_control_restart:hover, input.svc_control_restart:active {
+ background-image: url(svc_reload_active.png) ! important;
+}
+input.svc_control_restart:disabled {
+ background-image: url(svc_reload_disabled.png) ! important;
+ cursor: url('cursor-disabled.png'), default;
+}
+
+input.svc_control_stop {
+ background-image: url(svc_stop.png);
+}
+input.svc_control_stop:hover, input.svc_control_stop:active {
+ background-image: url(svc_stop_active.png) ! important;
+}
+input.svc_control_stop:disabled {
+ background-image: url(svc_stop_disabled.png) ! important;
+ cursor: url('cursor-disabled.png'), default;
+}
--- conga/luci/site/luci/Extensions/LuciDB.py 2007/06/27 08:14:13 1.3
+++ conga/luci/site/luci/Extensions/LuciDB.py 2007/06/28 16:02:50 1.4
@@ -6,7 +6,6 @@
# Free Software Foundation.
from AccessControl import getSecurityManager
-import RicciQueries as rq
from ricci_communicator import RicciCommunicator
from LuciZopePerm import isAdmin
from LuciSyslog import get_logger
--- conga/luci/site/luci/Extensions/ClusterModel/.cvsignore 2007/06/18 18:39:33 1.1
+++ conga/luci/site/luci/Extensions/ClusterModel/.cvsignore 2007/06/28 16:02:50 1.2
@@ -0,0 +1,2 @@
+*.pyc
+*.pyo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-06-28 16:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-10 16:00 [Cluster-devel] conga/luci homebase/luci_homebase.css site/luc rmccabe
-- strict thread matches above, loose matches on Subject: below --
2007-06-28 16:02 rmccabe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).