r5509 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2012-10-15 15:14:27 +0000 (Mon, 15 Oct 2012)
New Revision: 5509
Modified:
trunk/cumin/python/cumin/grid/negotiator.py
Log:
Addressing problem with rendering the values for the quota editing pie chart. Previously, if a group was looked for, but not there (perhaps correctly so), we were silently failing instead of silently continuing.
Modified: trunk/cumin/python/cumin/grid/negotiator.py
===================================================================
--- trunk/cumin/python/cumin/grid/negotiator.py 2012-10-12 20:53:09 UTC (rev 5508)
+++ trunk/cumin/python/cumin/grid/negotiator.py 2012-10-15 15:14:27 UTC (rev 5509)
@@ -308,10 +308,12 @@
info = self.group_helper.get_config_for_groups(session, "GROUP_QUOTA_DYNAMIC", groups)
values = []
dynamic_groups = []
- try:
- dynamic_groups = ["%s" % x for x in groups if info[x]["GROUP_QUOTA_DYNAMIC"] != ""]
- except:
- log.error("Error when loading dynamic group values for quota editing.")
+ for x in groups:
+ try:
+ if info[x]["GROUP_QUOTA_DYNAMIC"] != "":
+ dynamic_groups.append(x)
+ except Exception, e:
+ pass
for group in sorted(groups):
if(group in dynamic_groups):
values.append(self.render_quota_value(session, group))
@@ -327,10 +329,12 @@
info = self.group_helper.get_config_for_groups(session, "GROUP_QUOTA_DYNAMIC", groups)
values = []
dynamic_groups = []
- try:
- dynamic_groups = ["%s" % x for x in groups if info[x]["GROUP_QUOTA_DYNAMIC"] != ""]
- except:
- log.error("Error when loading dynamic group names for quota editing.")
+ for x in groups:
+ try:
+ if info[x]["GROUP_QUOTA_DYNAMIC"] != "":
+ dynamic_groups.append(x)
+ except Exception, e:
+ pass
for group in sorted(groups):
if(group in dynamic_groups):
values.append(group)
11 years, 6 months
r5508 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2012-10-12 20:53:09 +0000 (Fri, 12 Oct 2012)
New Revision: 5508
Modified:
trunk/cumin/python/cumin/grid/negotiator.py
trunk/cumin/python/cumin/grid/negotiator.strings
Log:
For BZ 635207. If a quota being edited has subshares, there will now be links to edit those subshares on the Quota editing form.
Modified: trunk/cumin/python/cumin/grid/negotiator.py
===================================================================
--- trunk/cumin/python/cumin/grid/negotiator.py 2012-10-11 16:11:21 UTC (rev 5507)
+++ trunk/cumin/python/cumin/grid/negotiator.py 2012-10-12 20:53:09 UTC (rev 5508)
@@ -123,7 +123,21 @@
self.info.set(session, info)
return info[group]['has_child']
+
+ def get_children(self, session, group):
+ info = self.get_config_info(session)
+ try:
+ return info[group]['children']
+ except KeyError:
+ info[group]['children'] = list()
+ for key in info:
+ if key.startswith(group+"."):
+ info[group]['children'].append(key)
+
+ self.info.set(session, info)
+ return info[group]['children']
+
def get_parent(self, session, group):
info = self.get_config_info(session)
@@ -287,6 +301,8 @@
return "Percent"
def render_all_group_values(self, session):
+ all_groups = self.group_helper.get_config_info(session)
+ self.group_helper.get_config_for_groups(session, "GROUP_QUOTA_DYNAMIC", all_groups)
group_leader = self.group_leader.get(session)
groups = self.group_helper.get_siblings(session, group_leader)
info = self.group_helper.get_config_for_groups(session, "GROUP_QUOTA_DYNAMIC", groups)
@@ -404,6 +420,28 @@
return None
return str(pri / 100)
+
+ def render_subshares(self, session):
+ links = ""
+ common_parent = self.group_leader.get(session)
+ subshares = self.group_helper.get_children(session, self.group_leader.get(session))
+ for share in subshares:
+ if self.group_helper.get_parent(session, share) == common_parent:
+ links += '''<li><a href="%s">%s</a></li>''' % (self.task.get_href_group(session, share) , share)
+ return "%s" % links
+
+ def render_subshares_title(self, session):
+ subshares = self.group_helper.get_children(session, self.group_leader.get(session))
+ if len(subshares) > 0:
+ current_node = self.group_leader.get(session)
+ breadcrumbs = ["""<a href="%s">%s</a>""" % (self.task.get_href_group(session, current_node), current_node)]
+ while self.group_helper.get_parent(session, current_node) != "":
+ breadcrumbs.append("""<a href="%s">%s</a>""" % (self.task.get_href_group(session, self.group_helper.get_parent(session, current_node)), self.group_helper.get_parent(session, current_node)))
+ current_node = self.group_helper.get_parent(session, current_node)
+ breadcrumbs.reverse()
+ return "Edit subshares for %s" % " > ".join(breadcrumbs)
+ else:
+ return ""
class PriorityPieChart(StatFlashChart):
def __init__(self, app, name, negotiator, group_helper, group_leader):
@@ -453,6 +491,7 @@
class NegotiatorEditDynamicQuota(NegotiatorGroupTask):
def __init__(self, app, frame):
super(NegotiatorEditDynamicQuota, self).__init__(app, frame)
+ self.frame = frame
self.form = EditDynamicQuotaForm(app, self.name, self)
# don't show in page summary section
@@ -470,4 +509,12 @@
negotiator = self.frame.negotiator_attribute.get(osession)
self.form.negotiator.set(session, negotiator)
+
+ def get_href_group(self, session, group):
+ task = self.frame.edit_dynamic_quota
+ nsession = session.branch()
+ task.form.group_leader.set(nsession, group)
+ url = self.form.return_url.get(session)
+ task.form.return_url.set(nsession, url)
+ return nsession.marshal()
Modified: trunk/cumin/python/cumin/grid/negotiator.strings
===================================================================
--- trunk/cumin/python/cumin/grid/negotiator.strings 2012-10-11 16:11:21 UTC (rev 5507)
+++ trunk/cumin/python/cumin/grid/negotiator.strings 2012-10-12 20:53:09 UTC (rev 5508)
@@ -15,6 +15,14 @@
</tbody>
</table>
<div><div id="holder" style="width:400px;height:250px;" class="StatValueChart"></div></div><div style="clear:left;"><!-- --></div>
+ <div class="subshares_title">
+ <h1>
+ {subshares_title}
+ </h1>
+ </div>
+ <div class="subshares">
+ {subshares}
+ </div>
</div>
<div class="foot">
{submit}
@@ -163,6 +171,16 @@
border: 1px solid #f00;
}
+.subshares {
+ margin-left:10px;
+}
+.subshares li {
+ list-style:none;
+}
+.subshares_title h1{
+ margin-bottom:0px;
+}
+
[EditDynamicQuotaForm.javascript]
cumin.get_quota_sum = function () {
var elems = document.forms[0].elements;
11 years, 6 months
New Cumin blog on github
by Trevor McKay
Hello,
I've started a blog on github at tmckayus.github.com. This will be
mostly dedicated to Cumin, although I might post other technical things
there from time to time.
For a specific atom feed that contains only cumin posts, you can use
tmckayus.github.com/cumin.xml
If you have ideas for blog posts, feedback, or content you'd like to
submit for a post, you can send an email to this list or to me at
tmckay.redhat.com.
Thanks!
Trevor
11 years, 6 months
r5507 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2012-10-11 16:11:21 +0000 (Thu, 11 Oct 2012)
New Revision: 5507
Modified:
trunk/cumin/python/cumin/grid/quota.py
Log:
Fixing width of expand (+/-) column on quota page.
Modified: trunk/cumin/python/cumin/grid/quota.py
===================================================================
--- trunk/cumin/python/cumin/grid/quota.py 2012-10-11 14:42:57 UTC (rev 5506)
+++ trunk/cumin/python/cumin/grid/quota.py 2012-10-11 16:11:21 UTC (rev 5507)
@@ -146,7 +146,7 @@
col = self.ExpandColumn(app, "id", cls.id, self.expand, self.group_helper)
col.header_class = StaticColumnHeader
- col.width = "20px"
+ col.width = "30px"
self.add_column(col)
col = self.GroupColumn(app, "group", cls.Name)
11 years, 6 months
r5506 - in trunk/cumin: etc python/cumin
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-10-11 14:42:57 +0000 (Thu, 11 Oct 2012)
New Revision: 5506
Added:
trunk/cumin/etc/cumin.messaging.conf
Modified:
trunk/cumin/etc/cumin.conf
trunk/cumin/python/cumin/config.py
Log:
Support messaging persona through an additional config file that
overrides default settings (grid) in the standard config file.
BZ846010
Modified: trunk/cumin/etc/cumin.conf
===================================================================
--- trunk/cumin/etc/cumin.conf 2012-10-10 20:30:51 UTC (rev 5505)
+++ trunk/cumin/etc/cumin.conf 2012-10-11 14:42:57 UTC (rev 5506)
@@ -9,10 +9,7 @@
# If a configuration section does not set a value for
# a particular parameter, the parameter is searched for
# in the [common] section. This allows values to be set
-# globally and then optionally overridden per section.
-# For example, to set the 'persona' value to grid for every
-# web section in the file, you may add 'persona: grid'
-# to the common section.
+# globally and then optionally overridden per section.
[common]
# database: dbname=cumin
@@ -78,25 +75,13 @@
# webs: web
# Default cumin-data configuration at installation.
-# Assumes 'persona' setting in the web section is 'grid'
# Expiration of samples and vacuuming of the database is handled
# by the data.grid thread.
datas: data.grid, data.grid-slots, data.grid-submissions, data.sesame
-# If the 'persona' setting in the web section is set to 'default' then
-# the 'data.other' section should be added as follows.
-#datas: data.grid, data.grid-slots, data.grid-submissions, data.sesame, data.other
-
-# If the 'persona' setting in the web section is set to 'messaging' then
-# the 'data.grid*' section names may be omitted from 'datas' as follows.
-# ***NOTE*** that in this case the data.grid section will not be included
-# so the expire and vacuum settings should be changed in one of these sections.
-# Failure to do so will cause the database to grow continually!
-#datas: data.sesame, data.other
-
# To run a single cumin-data process in a small deployment set 'datas' as follows
# and optionally modify 'include-classes' and 'exclude-classes' in the [data]
-# section based on 'persona'. See additional comments in [data] section.
+# section. See additional comments in [data] section.
#datas: data
# Reporting is off by default.
@@ -114,7 +99,6 @@
# operator-email: [none]
# update-interval: 10
# max-qmf-table-sort: 1000
-# persona: grid
# authorize: False
# auth:
# ldap_tls_cacertfile:
@@ -135,21 +119,10 @@
# expire-threshold: 86400
# vacuum-enabled: True
# vacuum-interval: 3600
-# include-classes: [all]
+include-classes: com.redhat.grid:*, com.redhat.sesame:*
# exclude-classes: [none]
-# If 'persona' in the web section is set to 'default'
-# then include-classes and exclude-classes should be
-# left unspecified (the default)
-# If 'persona' in the web section is set to 'grid' then
-# set include-classes as follows and leave exclude-classes unspecified
-#include-classes: com.redhat.grid:*, com.redhat.sesame:*
-
-# If 'persona' in the web section is set to 'messaging' then
-# set exclude-classes as follows and leave include-classes unspecified
-#exclude-classes: com.redhat.grid:*
-
[data.grid]
# log-file: /usr/share/cumin/log/data.grid.log
# expire-enabled: True
@@ -192,16 +165,6 @@
include-classes: com.redhat.sesame:*
# exclude-classes: [none]
-[data.other]
-# log-file: /usr/share/cumin/log/data.other.log
-expire-enabled: False
-# expire-interval: 3600
-# expire-threshold: 86400
-vacuum-enabled: False
-# vacuum-interval: 3600
-# include-classes: [all]
-exclude-classes: com.redhat.grid:*, com.redhat.sesame:*
-
[report]
# include-classes: [all]
# exclude-classes: [none]
@@ -234,7 +197,7 @@
## wallaby-broker: [first item in 'brokers' list]
## The broker to use for interaction with a Wallaby agent.
## This is not necessarily the same broker used for grid
-## and messaging information. The default value is the
+## information. The default value is the
## first item in the 'brokers' list if not specified. To
## turn off interaction with Wallaby, set wallaby-broker to
## the string 'None'.
@@ -306,12 +269,6 @@
## set and valid, Cumin will use ssl. The scheme in the
## Cumin URL will be "https://" instead of "http://".
-## persona: grid
-## Controls content of the top level page.
-## Valid values are "default", "grid", and "messaging".
-## The "default" persona contains content for both grid and
-## messaging.
-
## authorize: False
## Controls whether or not roles are enforced.
## Roles are assigned to users with cumin-admin.
Added: trunk/cumin/etc/cumin.messaging.conf
===================================================================
--- trunk/cumin/etc/cumin.messaging.conf (rev 0)
+++ trunk/cumin/etc/cumin.messaging.conf 2012-10-11 14:42:57 UTC (rev 5506)
@@ -0,0 +1,23 @@
+[web]
+persona: messaging
+
+[master]
+#datas: data
+datas: data.sesame, data.messaging
+
+# Use this for a simple deployment with a
+# single cumin-data instance. Set 'datas'
+# to 'data' in the [master] section above.
+[data]
+include-classes:
+exclude-classes: com.redhat.grid:*
+
+[data.messaging]
+# log-file: /usr/share/cumin/log/data.messaging.log
+# expire-enabled: True
+expire-interval: 900
+# expire-threshold: 86400
+# vacuum-enabled: True
+vacuum-interval: 900
+# include-classes: [all]
+exclude-classes: com.redhat.grid:*, com.redhat.sesame:*
\ No newline at end of file
Modified: trunk/cumin/python/cumin/config.py
===================================================================
--- trunk/cumin/python/cumin/config.py 2012-10-10 20:30:51 UTC (rev 5505)
+++ trunk/cumin/python/cumin/config.py 2012-10-11 14:42:57 UTC (rev 5506)
@@ -44,6 +44,9 @@
paths = list()
paths.append(os.path.join(os.sep, "etc", "cumin", "cumin.conf"))
+ # for messaging installation /etc/cumin.conf.d/messaging.conf should
+ # contain settings for the messaging persona.
+ paths.append(os.path.join(os.sep, "etc", "cumin", "cumin.conf.d", "messaging.conf"))
paths.append(os.path.join(self.home, "etc", "cumin.conf"))
paths.append(os.path.join(os.path.expanduser("~"), ".cumin.conf"))
11 years, 6 months
r5505 - branches/persona/cumin/etc
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-10-10 20:30:51 +0000 (Wed, 10 Oct 2012)
New Revision: 5505
Added:
branches/persona/cumin/etc/cumin.messaging.conf
Log:
This file accidentally left out
Added: branches/persona/cumin/etc/cumin.messaging.conf
===================================================================
--- branches/persona/cumin/etc/cumin.messaging.conf (rev 0)
+++ branches/persona/cumin/etc/cumin.messaging.conf 2012-10-10 20:30:51 UTC (rev 5505)
@@ -0,0 +1,23 @@
+[web]
+persona: messaging
+
+[master]
+#datas: data
+datas: data.sesame, data.messaging
+
+# Use this for a simple deployment with a
+# single cumin-data instance. Set 'datas'
+# to 'data' in the [master] section above.
+[data]
+include-classes:
+exclude-classes: com.redhat.grid:*
+
+[data.messaging]
+# log-file: /usr/share/cumin/log/data.messaging.log
+# expire-enabled: True
+expire-interval: 900
+# expire-threshold: 86400
+# vacuum-enabled: True
+vacuum-interval: 900
+# include-classes: [all]
+exclude-classes: com.redhat.grid:*, com.redhat.sesame:*
\ No newline at end of file
11 years, 6 months
r5504 - in branches/persona/cumin: etc python/cumin
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-10-10 17:18:53 +0000 (Wed, 10 Oct 2012)
New Revision: 5504
Modified:
branches/persona/cumin/etc/cumin.conf
branches/persona/cumin/python/cumin/config.py
Log:
Remove persona setting comments from cumin.conf and
set up cumin to read optional messaging config.
Modified: branches/persona/cumin/etc/cumin.conf
===================================================================
--- branches/persona/cumin/etc/cumin.conf 2012-10-10 17:11:04 UTC (rev 5503)
+++ branches/persona/cumin/etc/cumin.conf 2012-10-10 17:18:53 UTC (rev 5504)
@@ -9,10 +9,7 @@
# If a configuration section does not set a value for
# a particular parameter, the parameter is searched for
# in the [common] section. This allows values to be set
-# globally and then optionally overridden per section.
-# For example, to set the 'persona' value to grid for every
-# web section in the file, you may add 'persona: grid'
-# to the common section.
+# globally and then optionally overridden per section.
[common]
# database: dbname=cumin
@@ -78,25 +75,13 @@
# webs: web
# Default cumin-data configuration at installation.
-# Assumes 'persona' setting in the web section is 'grid'
# Expiration of samples and vacuuming of the database is handled
# by the data.grid thread.
datas: data.grid, data.grid-slots, data.grid-submissions, data.sesame
-# If the 'persona' setting in the web section is set to 'default' then
-# the 'data.other' section should be added as follows.
-#datas: data.grid, data.grid-slots, data.grid-submissions, data.sesame, data.other
-
-# If the 'persona' setting in the web section is set to 'messaging' then
-# the 'data.grid*' section names may be omitted from 'datas' as follows.
-# ***NOTE*** that in this case the data.grid section will not be included
-# so the expire and vacuum settings should be changed in one of these sections.
-# Failure to do so will cause the database to grow continually!
-#datas: data.sesame, data.other
-
# To run a single cumin-data process in a small deployment set 'datas' as follows
# and optionally modify 'include-classes' and 'exclude-classes' in the [data]
-# section based on 'persona'. See additional comments in [data] section.
+# section. See additional comments in [data] section.
#datas: data
# Reporting is off by default.
@@ -114,7 +99,6 @@
# operator-email: [none]
# update-interval: 10
# max-qmf-table-sort: 1000
-# persona: grid
# authorize: False
# auth:
# ldap_tls_cacertfile:
@@ -135,21 +119,10 @@
# expire-threshold: 86400
# vacuum-enabled: True
# vacuum-interval: 3600
-# include-classes: [all]
+include-classes: com.redhat.grid:*, com.redhat.sesame:*
# exclude-classes: [none]
-# If 'persona' in the web section is set to 'default'
-# then include-classes and exclude-classes should be
-# left unspecified (the default)
-# If 'persona' in the web section is set to 'grid' then
-# set include-classes as follows and leave exclude-classes unspecified
-#include-classes: com.redhat.grid:*, com.redhat.sesame:*
-
-# If 'persona' in the web section is set to 'messaging' then
-# set exclude-classes as follows and leave include-classes unspecified
-#exclude-classes: com.redhat.grid:*
-
[data.grid]
# log-file: /usr/share/cumin/log/data.grid.log
# expire-enabled: True
@@ -192,16 +165,6 @@
include-classes: com.redhat.sesame:*
# exclude-classes: [none]
-[data.other]
-# log-file: /usr/share/cumin/log/data.other.log
-expire-enabled: False
-# expire-interval: 3600
-# expire-threshold: 86400
-vacuum-enabled: False
-# vacuum-interval: 3600
-# include-classes: [all]
-exclude-classes: com.redhat.grid:*, com.redhat.sesame:*
-
[report]
# include-classes: [all]
# exclude-classes: [none]
@@ -234,7 +197,7 @@
## wallaby-broker: [first item in 'brokers' list]
## The broker to use for interaction with a Wallaby agent.
## This is not necessarily the same broker used for grid
-## and messaging information. The default value is the
+## information. The default value is the
## first item in the 'brokers' list if not specified. To
## turn off interaction with Wallaby, set wallaby-broker to
## the string 'None'.
@@ -306,12 +269,6 @@
## set and valid, Cumin will use ssl. The scheme in the
## Cumin URL will be "https://" instead of "http://".
-## persona: grid
-## Controls content of the top level page.
-## Valid values are "default", "grid", and "messaging".
-## The "default" persona contains content for both grid and
-## messaging.
-
## authorize: False
## Controls whether or not roles are enforced.
## Roles are assigned to users with cumin-admin.
Modified: branches/persona/cumin/python/cumin/config.py
===================================================================
--- branches/persona/cumin/python/cumin/config.py 2012-10-10 17:11:04 UTC (rev 5503)
+++ branches/persona/cumin/python/cumin/config.py 2012-10-10 17:18:53 UTC (rev 5504)
@@ -44,6 +44,9 @@
paths = list()
paths.append(os.path.join(os.sep, "etc", "cumin", "cumin.conf"))
+ # for messaging installation /etc/cumin.conf.d/messaging.conf should
+ # contain settings for the messaging persona.
+ paths.append(os.path.join(os.sep, "etc", "cumin", "cumin.conf.d", "messaging.conf"))
paths.append(os.path.join(self.home, "etc", "cumin.conf"))
paths.append(os.path.join(os.path.expanduser("~"), ".cumin.conf"))
11 years, 6 months
r5503 - branches
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-10-10 17:11:04 +0000 (Wed, 10 Oct 2012)
New Revision: 5503
Added:
branches/persona/
Log:
Create a branch to play with persona
11 years, 6 months
r5502 - trunk/cumin/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2012-10-10 13:23:31 +0000 (Wed, 10 Oct 2012)
New Revision: 5502
Modified:
trunk/cumin/resources/app.css
Log:
Removing unnecessary padding on last chart radio button that causes ugly break in chrome.
Modified: trunk/cumin/resources/app.css
===================================================================
--- trunk/cumin/resources/app.css 2012-10-09 19:36:14 UTC (rev 5501)
+++ trunk/cumin/resources/app.css 2012-10-10 13:23:31 UTC (rev 5502)
@@ -283,6 +283,7 @@
ul.radiotabs li:last-child {
display: inline;
margin: 0;
+ padding: 0;
}
ul.radiotabs li a:before {
@@ -822,4 +823,4 @@
ul.autocompleter-choices li.autocompleter-selected span.autocompleter-queried
{
color: #9FCFFF;
-}
\ No newline at end of file
+}
11 years, 6 months
r5501 - trunk/wooly/python/wooly
by croberts@fedoraproject.org
Author: croberts
Date: 2012-10-09 19:36:14 +0000 (Tue, 09 Oct 2012)
New Revision: 5501
Modified:
trunk/wooly/python/wooly/table.strings
Log:
Adding the rendering of the <col> tags to all data tables. This gives us a better handle on setting the column widths.
Modified: trunk/wooly/python/wooly/table.strings
===================================================================
--- trunk/wooly/python/wooly/table.strings 2012-10-09 17:36:12 UTC (rev 5500)
+++ trunk/wooly/python/wooly/table.strings 2012-10-09 19:36:14 UTC (rev 5501)
@@ -31,6 +31,7 @@
[Table.html]
<table id="{id}" class="{class}">
+ {columns}
<style type="text/css">
{css}
</style>
11 years, 6 months