* [Cluster-devel] conga/luci/site/luci/Extensions StorageReport.py
@ 2006-08-02 23:18 kupcevic
0 siblings, 0 replies; 7+ messages in thread
From: kupcevic @ 2006-08-02 23:18 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Changes by: kupcevic at sourceware.org 2006-08-02 23:18:57
Modified files:
luci/site/luci/Extensions: StorageReport.py
Log message:
luci: storage: pass plone context as self to all storage external methods (will be used for prefered size variables)
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&r1=1.4&r2=1.5
--- conga/luci/site/luci/Extensions/StorageReport.py 2006/07/18 20:33:04 1.4
+++ conga/luci/site/luci/Extensions/StorageReport.py 2006/08/02 23:18:57 1.5
@@ -8,6 +8,7 @@
from ricci_defines import *
from PropsObject import PropsObject
from conga_storage_constants import *
+from HelperFunctions import *
from ricci_communicator import get_ricci_communicator
@@ -312,8 +313,8 @@
-def get_content_data(storage_report, mapper_id, bd_path, content_id):
- bd_data = get_bd_data(storage_report, mapper_id, bd_path)
+def get_content_data(self, storage_report, mapper_id, bd_path, content_id):
+ bd_data = get_bd_data(self, storage_report, mapper_id, bd_path)
for cont in bd_data['contents']:
if cont['id'] == content_id:
return cont
@@ -321,11 +322,11 @@
-def get_bd_data(storage_report, mapper_id, path):
+def get_bd_data(self, storage_report, mapper_id, path):
if storage_report == None or mapper_id == None:
return None
- mapper = get_mapper_data(storage_report, mapper_id)
+ mapper = get_mapper_data(self, storage_report, mapper_id)
if mapper == None:
return None
@@ -341,7 +342,7 @@
-def get_mappers_data(storage_report):
+def get_mappers_data(self, storage_report):
ret_dir = {}
# mappers
mappers_dir = storage_report.get_mappers_dir()
@@ -352,13 +353,13 @@
ret_dir[mapp_type] = {}
ret_dir[mapp_type]['mappers'] = []
ret_dir[mapp_type]['mapper_template'] = None
- ret_dir[mapp_type]['mappers'].append(get_mapper_data(storage_report, id))
+ ret_dir[mapp_type]['mappers'].append(get_mapper_data(self, storage_report, id))
# templates
for mapp_type in storage_report.get_mapper_temps_dir():
if mapp_type not in ret_dir:
ret_dir[mapp_type] = {}
ret_dir[mapp_type]['mappers'] = []
- ret_dir[mapp_type]['mapper_template'] = get_mapper_template_data(storage_report, mapp_type)
+ ret_dir[mapp_type]['mapper_template'] = get_mapper_template_data(self, storage_report, mapp_type)
# pretty stuff
for mapp_type in ret_dir:
@@ -378,28 +379,30 @@
-def get_mapper_data(storage_report, mapper_id):
- if storage_report == None or mapper_id == None:
+def get_mapper_data(self, storage_report, mapper_id):
+ if self == None or storage_report == None or mapper_id == None:
return None
+ session = self.REQUEST.SESSION
+
mapper = storage_report.get_mapper(mapper_id)
if mapper == None:
return None
- removable, props = get_props_data_internal(mapper)
+ removable, props = get_props_data_internal(session, mapper)
new_targets = []
for t_xml in storage_report.get_new_targets(mapper):
- new_targets.append(get_bd_data_internal(t_xml, mapper))
+ new_targets.append(get_bd_data_internal(session, t_xml, mapper))
new_sources = []
for s_xml in storage_report.get_new_sources(mapper):
- new_sources.append(get_bd_data_internal(s_xml, mapper))
+ new_sources.append(get_bd_data_internal(session, s_xml, mapper))
targets = []
for t_xml in storage_report.get_targets(mapper):
- targets.append(get_bd_data_internal(t_xml, mapper))
+ targets.append(get_bd_data_internal(session, t_xml, mapper))
sources = []
for s_xml in storage_report.get_sources(mapper):
- sources.append(get_bd_data_internal(s_xml, mapper))
+ sources.append(get_bd_data_internal(session, s_xml, mapper))
type = mapper.getAttribute('mapper_type')
pretty_type = 'Mapper'
@@ -567,10 +570,12 @@
-def get_mapper_template_data(storage_report, mapper_type):
- if storage_report == None or mapper_type == None:
+def get_mapper_template_data(self, storage_report, mapper_type):
+ if self == None or storage_report == None or mapper_type == None:
return None
+ session = self.REQUEST.SESSION
+
mapper_id = ''
templ_xml_list = storage_report.get_mapper_temps(mapper_type)
@@ -580,20 +585,20 @@
if mapper == None:
return None
- removable, props = get_props_data_internal(mapper)
+ removable, props = get_props_data_internal(session, mapper)
new_targets = []
for t_xml in storage_report.get_new_targets(mapper):
- new_targets.append(get_bd_data_internal(t_xml, mapper))
+ new_targets.append(get_bd_data_internal(session, t_xml, mapper))
new_sources = []
for s_xml in storage_report.get_new_sources(mapper):
- new_sources.append(get_bd_data_internal(s_xml, mapper))
+ new_sources.append(get_bd_data_internal(session, s_xml, mapper))
targets = []
for t_xml in storage_report.get_targets(mapper):
- targets.append(get_bd_data_internal(t_xml, mapper))
+ targets.append(get_bd_data_internal(session, t_xml, mapper))
sources = []
for s_xml in storage_report.get_sources(mapper):
- sources.append(get_bd_data_internal(s_xml, mapper))
+ sources.append(get_bd_data_internal(session, s_xml, mapper))
type = mapper.getAttribute('mapper_type')
pretty_type = 'Mapper'
@@ -685,7 +690,7 @@
# TODO: implement
-def validate(storage_report, request):
+def validate(self, storage_report, request):
#return 'size has to be within limits'
#return request
#return 'OK'
@@ -698,7 +703,7 @@
if object_type == 'bd' or object_type == 'bd_template':
path = request[PT_PATH]
- bd_data = get_bd_data(storage_report, mapper_id, path)
+ bd_data = get_bd_data(self, storage_report, mapper_id, path)
props = bd_data['props']
if path != 'new_snapshot':
selected_content_id = request['content_id']
@@ -706,10 +711,10 @@
if c_data['id'] == selected_content_id:
content_props = c_data['props']
elif object_type == 'mapper':
- props = get_mapper_data(storage_report, mapper_id)['props']
+ props = get_mapper_data(self, storage_report, mapper_id)['props']
elif object_type == 'mapper_template':
mapper_type = request['mapper_type']
- data = get_mapper_template_data(storage_report, mapper_type)
+ data = get_mapper_template_data(self, storage_report, mapper_type)
# find sources
sources_num = 0
for v in request.keys():
@@ -787,14 +792,16 @@
# TODO: implement
-def apply(ricci, storage_report, request, main_URL):
- if validate(storage_report, request) != 'OK':
+def apply(self, ricci, storage_report, request, main_URL):
+ if validate(self, storage_report, request) != 'OK':
return 'Internal error: input not validated!!!'
#return 'size has to be within limits'
#return request
#return main_URL
+ session = request.SESSION
+
storagename = request['storagename']
object_type = request['object_type']
@@ -807,7 +814,7 @@
if object_type == 'bd':
- bd_data = get_bd_data(storage_report, mapper_id, path)
+ bd_data = get_bd_data(self, storage_report, mapper_id, path)
bd_xml = bd_data['xml'].cloneNode(True)
if action_type == 'Remove':
@@ -856,7 +863,7 @@
node.setAttribute('value', request[var_name])
# content
- content_data_list = get_content_data_internal(bd_xml)
+ content_data_list = get_content_data_internal(session, bd_xml)
current_content_id = content_data_list[0]['id']
selected_content_id = request['content_id']
selected_content = None
@@ -972,7 +979,7 @@
elif object_type == 'bd_template':
path = request[PT_PATH]
- bd_data = get_bd_data(storage_report, mapper_id, path)
+ bd_data = get_bd_data(self, storage_report, mapper_id, path)
bd_xml = bd_data['xml'].cloneNode(True)
#return bd_xml.toprettyxml()
@@ -999,7 +1006,7 @@
if path != 'new_snapshot':
# content
- content_data_list = get_content_data_internal(bd_xml)
+ content_data_list = get_content_data_internal(session, bd_xml)
current_content_id = content_data_list[0]['id']
selected_content_id = request['content_id']
selected_content = None
@@ -1114,7 +1121,7 @@
elif object_type == 'mapper':
- mapper_data = get_mapper_data(storage_report, mapper_id)
+ mapper_data = get_mapper_data(self, storage_report, mapper_id)
mapper_xml = mapper_data['xml'].cloneNode(True)
#return mapper_xml.toprettyxml()
@@ -1225,7 +1232,7 @@
elif object_type == 'mapper_template':
- mapper_data = get_mapper_template_data(storage_report, mapper_type)
+ mapper_data = get_mapper_template_data(self, storage_report, mapper_type)
mapper_xml = mapper_data['xml'].cloneNode(True)
#return mapper_xml.toprettyxml()
@@ -1364,15 +1371,15 @@
-def get_bd_data_internal(bd_xml, mapper_xml):
+def get_bd_data_internal(session, bd_xml, mapper_xml):
data = {}
- removable, props = get_props_data_internal(bd_xml)
+ removable, props = get_props_data_internal(session, bd_xml)
path = bd_xml.getAttribute('path')
mapper_type = bd_xml.getAttribute('mapper_type')
mapper_id = bd_xml.getAttribute('mapper_id')
- contents = get_content_data_internal(bd_xml)
+ contents = get_content_data_internal(session, bd_xml)
type = bd_xml.getAttribute('mapper_type')
pretty_name = path.replace('/dev/','')
@@ -1459,7 +1466,7 @@
for node in nts.childNodes:
if node.nodeType == xml.dom.Node.ELEMENT_NODE:
if node.nodeName == BD_TEMPLATE:
- snap_lv = get_bd_data_internal(node, mapper_xml)
+ snap_lv = get_bd_data_internal(session, node, mapper_xml)
if snap_lv != None:
if snap_lv['props']['snapshot']['value'] == 'true':
origs = snap_lv['props']['snapshot_origin']['value']
@@ -1474,7 +1481,7 @@
-def get_props_data_internal(xml_tag):
+def get_props_data_internal(session, xml_tag):
data = {}
removable = False
@@ -1506,9 +1513,16 @@
if type == VARIABLE_TYPE_INT:
d_type = 'int'
d_value = value
- validation_data['min'] = var.getAttribute('min')
- validation_data['max'] = var.getAttribute('max')
- validation_data['step'] = var.getAttribute('step')
+ min = var.getAttribute('min')
+ max = var.getAttribute('max')
+ step = var.getAttribute('step')
+ if d_units == 'bytes':
+ # modify units
+
+ pass
+ validation_data['min'] = str(min)
+ validation_data['max'] = str(max)
+ validation_data['step'] = str(step)
elif type == VARIABLE_TYPE_STRING:
d_type = 'text'
d_value = value
@@ -1567,7 +1581,7 @@
-def get_content_data_internal(bd_xml):
+def get_content_data_internal(session, bd_xml):
c_xml = None
for node in bd_xml.childNodes:
if node.nodeType == xml.dom.Node.ELEMENT_NODE:
@@ -1589,7 +1603,7 @@
break
current = {}
- removable, props = get_props_data_internal(c_xml)
+ removable, props = get_props_data_internal(session, c_xml)
current['props'] = props
name, id = get_content_name_id(c_xml)
current['name'] = name
@@ -1599,7 +1613,7 @@
data = [current]
for a_xml in a_xmls:
available = {}
- removable, props = get_props_data_internal(a_xml)
+ removable, props = get_props_data_internal(session, a_xml)
available['props'] = props
name, id = get_content_name_id(a_xml)
available['name'] = name
@@ -1690,7 +1704,6 @@
return name, id
-
def build_systems_list(self, sort_by, allowed_systems):
sysl = []
for sys in allowed_systems:
@@ -1770,8 +1783,6 @@
return sorted
-
-
def get_mappings_info(self,
mapper_data,
length):
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions StorageReport.py
@ 2007-06-14 22:43 rmccabe
0 siblings, 0 replies; 7+ messages in thread
From: rmccabe @ 2007-06-14 22:43 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Branch: EXPERIMENTAL
Changes by: rmccabe at sourceware.org 2007-06-14 22:43:24
Modified files:
luci/site/luci/Extensions: StorageReport.py
Log message:
Resolve bz241418 (Conga tries to configurage cluster snaps, though they are not available)
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.23.2.6&r2=1.23.2.7
--- conga/luci/site/luci/Extensions/StorageReport.py 2007/06/01 23:18:16 1.23.2.6
+++ conga/luci/site/luci/Extensions/StorageReport.py 2007/06/14 22:43:24 1.23.2.7
@@ -1579,7 +1579,8 @@
if node.nodeType == xml.dom.Node.ELEMENT_NODE:
if node.nodeName == BD_TEMPLATE:
snap_lv = get_bd_data_internal(session, node, mapper_xml)
- if snap_lv is not None:
+
+ if snap_lv is not None and snap_lv['props']['clustered']['value'] != 'true':
if snap_lv['props']['snapshot']['value'] == 'true':
origs = snap_lv['props']['snapshot_origin']['value']
if pretty_name in origs:
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions StorageReport.py
@ 2007-06-15 15:33 rmccabe
0 siblings, 0 replies; 7+ messages in thread
From: rmccabe @ 2007-06-15 15:33 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL4
Changes by: rmccabe at sourceware.org 2007-06-15 15:33:58
Modified files:
luci/site/luci/Extensions: StorageReport.py
Log message:
Fix bz241417: Conga tries to configurage cluster snaps, though they are not available.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.22.2.1&r2=1.22.2.2
--- conga/luci/site/luci/Extensions/StorageReport.py 2007/03/05 20:22:35 1.22.2.1
+++ conga/luci/site/luci/Extensions/StorageReport.py 2007/06/15 15:33:58 1.22.2.2
@@ -1588,7 +1588,7 @@
if node.nodeType == xml.dom.Node.ELEMENT_NODE:
if node.nodeName == BD_TEMPLATE:
snap_lv = get_bd_data_internal(session, node, mapper_xml)
- if snap_lv != None:
+ if snap_lv is not None and snap_lv['props']['clustered']['value'] != 'true':
if snap_lv['props']['snapshot']['value'] == 'true':
origs = snap_lv['props']['snapshot_origin']['value']
if pretty_name in origs:
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions StorageReport.py
@ 2007-06-15 20:12 rmccabe
0 siblings, 0 replies; 7+ messages in thread
From: rmccabe @ 2007-06-15 20:12 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Branch: EXPERIMENTAL
Changes by: rmccabe at sourceware.org 2007-06-15 20:12:23
Modified files:
luci/site/luci/Extensions: StorageReport.py
Log message:
Fix mismatched parens that caused some storage operations to fail.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.23.2.7&r2=1.23.2.8
--- conga/luci/site/luci/Extensions/StorageReport.py 2007/06/14 22:43:24 1.23.2.7
+++ conga/luci/site/luci/Extensions/StorageReport.py 2007/06/15 20:12:23 1.23.2.8
@@ -11,7 +11,16 @@
from Variable import parse_variable, Variable, VariableList
-from ricci_defines import *
+from ricci_defines import BD_TEMPLATE, BD_TYPE, CONTENT_FS_TYPE, \
+ CONTENT_HIDDEN_TYPE, CONTENT_MS_TYPE, CONTENT_NONE_TYPE, \
+ CONTENT_TYPE, FUNC_RESP_TAG, MAPPER_ATARAID_TYPE, MAPPER_CRYPTO_TYPE, \
+ MAPPER_iSCSI_TYPE, MAPPER_MDRAID_TYPE, MAPPER_MULTIPATH_TYPE, \
+ MAPPER_NEW_SOURCES_TAG, MAPPER_NEW_TARGETS_TAG, MAPPER_PT_TYPE, \
+ MAPPER_SOURCES_TAG, MAPPER_SYS_TYPE, MAPPER_TARGETS_TAG, \
+ MAPPER_VG_TYPE, PROPS_TAG, RESPONSE_TAG, VARIABLE_TAG, \
+ VARIABLE_TYPE_BOOL, VARIABLE_TYPE_INT, VARIABLE_TYPE_INT_SEL, \
+ VARIABLE_TYPE_LISTENTRY, VARIABLE_TYPE_LIST_INT, VARIABLE_TYPE_LIST_STR, \
+ VARIABLE_TYPE_LIST_XML, VARIABLE_TYPE_STRING, VARIABLE_TYPE_STRING_SEL
from conga_storage_constants import ADD_SOURCES, get_fs_icon, \
get_mapper_icons, get_pretty_fs_name, get_pretty_mapper_info, \
@@ -829,7 +838,7 @@
f_call = doc.createElement("function_call")
f_call.setAttribute('name', 'remove_bd')
#f_call.appendChild(Variable('bd', bd_xml.cloneNode(True)).export_xml(doc))
- f_call.appendChild(Variable('bd', bd_xml.export_xml(doc)))
+ f_call.appendChild(Variable('bd', bd_xml).export_xml(doc))
req.appendChild(f_call)
module.appendChild(req)
@@ -1231,7 +1240,7 @@
f_call = doc.createElement("function_call")
f_call.setAttribute('name', 'create_mapper')
# f_call.appendChild(Variable('mapper', mapper_xml.cloneNode(True)).export_xml(doc))
- f_call.appendChild(Variable('mapper', mapper_xml.export_xml(doc)))
+ f_call.appendChild(Variable('mapper', mapper_xml).export_xml(doc))
req.appendChild(f_call)
module.appendChild(req)
@@ -2088,6 +2097,3 @@
ret['js'] = high_list_js
return ret
-
-
-
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions StorageReport.py
@ 2007-07-26 14:59 rmccabe
0 siblings, 0 replies; 7+ messages in thread
From: rmccabe @ 2007-07-26 14:59 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: rmccabe at sourceware.org 2007-07-26 14:59:26
Modified files:
luci/site/luci/Extensions: StorageReport.py
Log message:
Fix a typo that caused an exception to be thrown while viewing volumes with snapshots.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.20.2.4&r2=1.20.2.5
--- conga/luci/site/luci/Extensions/StorageReport.py 2007/06/18 18:39:32 1.20.2.4
+++ conga/luci/site/luci/Extensions/StorageReport.py 2007/07/26 14:59:26 1.20.2.5
@@ -2000,7 +2000,7 @@
'id' : '%s_origin' % bd['path'],
'type' : 'snapshot-origin'})
for snap in bd['snapshots']:
- high_list[d['id']].append('%s_snapshot', snap['path'])
+ high_list[d['id']].append('%s_snapshot' % snap['path'])
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions StorageReport.py
@ 2007-08-09 2:18 rmccabe
0 siblings, 0 replies; 7+ messages in thread
From: rmccabe @ 2007-08-09 2:18 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: rmccabe at sourceware.org 2007-08-09 02:18:39
Modified files:
luci/site/luci/Extensions: StorageReport.py
Log message:
Fix 250834
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.20.2.5&r2=1.20.2.6
--- conga/luci/site/luci/Extensions/StorageReport.py 2007/07/26 14:59:26 1.20.2.5
+++ conga/luci/site/luci/Extensions/StorageReport.py 2007/08/09 02:18:38 1.20.2.6
@@ -2060,7 +2060,7 @@
length_in_bytes = 0
for t in mapper_data['sources']:
length_in_bytes += int(t['props']['size']['value'])
- ppb = (length * 1.0) / length_in_bytes # pixels per byte
+ ppb = (length * 1.0) / max(0.00001, length_in_bytes) # pixels per byte
lower_cyl['offset'] = int(lower_cyl['offset'] * ppb)
for d in lower_cyl['cyls']:
d['beg'] = int(d['beg'] * ppb)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Cluster-devel] conga/luci/site/luci/Extensions StorageReport.py
@ 2007-11-06 19:29 rmccabe
0 siblings, 0 replies; 7+ messages in thread
From: rmccabe @ 2007-11-06 19:29 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2007-11-06 19:29:16
Modified files:
luci/site/luci/Extensions: StorageReport.py
Log message:
Fix Bugzilla Bug 253727: RFE: graphical view should be default in partiton tables view
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&r1=1.28&r2=1.29
--- conga/luci/site/luci/Extensions/StorageReport.py 2007/09/24 21:19:42 1.28
+++ conga/luci/site/luci/Extensions/StorageReport.py 2007/11/06 19:29:15 1.29
@@ -479,8 +479,7 @@
if mapper_type == MAPPER_VG_TYPE:
link_snapshots(mapper_ret)
- # cylinders work properly for VGs only, for now
- mapper_ret['graphical_view'] = mapper_type != MAPPER_PT_TYPE
+ mapper_ret['graphical_view'] = True
if mapper_ret['graphical_view']:
mapper_ret['mappings-view_css_classnames'] = {
'graphical_view': 'visible',
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-11-06 19:29 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-02 23:18 [Cluster-devel] conga/luci/site/luci/Extensions StorageReport.py kupcevic
-- strict thread matches above, loose matches on Subject: below --
2007-06-14 22:43 rmccabe
2007-06-15 15:33 rmccabe
2007-06-15 20:12 rmccabe
2007-07-26 14:59 rmccabe
2007-08-09 2:18 rmccabe
2007-11-06 19:29 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).