r4736 - trunk/parsley/python/parsley
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-04-25 19:40:57 +0000 (Mon, 25 Apr 2011)
New Revision: 4736
Modified:
trunk/parsley/python/parsley/config.py
Log:
Tweak config param conversion for boolean values
Modified: trunk/parsley/python/parsley/config.py
===================================================================
--- trunk/parsley/python/parsley/config.py 2011-04-25 17:02:31 UTC (rev 4735)
+++ trunk/parsley/python/parsley/config.py 2011-04-25 19:40:57 UTC (rev 4736)
@@ -77,7 +77,7 @@
def unmarshal(self, string):
if self.type == bool:
- return string not in ["False","false","0"]
+ return string.lower() not in ("f", "false", "no", "0")
return self.type(string)
class ConfigValues(dict):
13 years
r4735 - in trunk: cumin/bin cumin/python/cumin mint/python/mint parsley/python/parsley
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-04-25 17:02:31 +0000 (Mon, 25 Apr 2011)
New Revision: 4735
Modified:
trunk/cumin/bin/cumin-data
trunk/cumin/python/cumin/config.py
trunk/mint/python/mint/expire.py
trunk/mint/python/mint/vacuum.py
trunk/parsley/python/parsley/config.py
Log:
Allow vacuuming and expiration to be disabled from config file.
This is to support vacuum/expire from a single thread
Modified: trunk/cumin/bin/cumin-data
===================================================================
--- trunk/cumin/bin/cumin-data 2011-04-25 12:58:05 UTC (rev 4734)
+++ trunk/cumin/bin/cumin-data 2011-04-25 17:02:31 UTC (rev 4735)
@@ -131,6 +131,8 @@
parser.add_option("--print-events", type="int", default=0, metavar="LEVEL")
parser.add_option("--section", default="data")
parser.add_option("--daemon", action="store_true", default=False)
+ parser.add_option("--no-vacuum", dest="vacuum_enabled", action="store_false")
+ parser.add_option("--no-expire", dest="expire_enabled", action="store_false")
# Get options
opts, args = parser.parse_args()
@@ -161,9 +163,11 @@
mint.print_event_level = opts.print_events
+ mint.expire_enabled = opts.expire_enabled
mint.expire_thread.interval = values.expire_interval
mint.expire_thread.threshold = values.expire_threshold
+ mint.vacuum_enabled = opts.vacuum_enabled
mint.vacuum_thread.interval = values.vacuum_interval
mint.check()
Modified: trunk/cumin/python/cumin/config.py
===================================================================
--- trunk/cumin/python/cumin/config.py 2011-04-25 12:58:05 UTC (rev 4734)
+++ trunk/cumin/python/cumin/config.py 2011-04-25 17:02:31 UTC (rev 4735)
@@ -60,12 +60,18 @@
param = ConfigParameter(data, "exclude-classes", str)
param = ConfigParameter(data, "agents", str)
+ param = ConfigParameter(data, "expire-enabled", bool)
+ param.default = True
+
param = ConfigParameter(data, "expire-interval", int)
param.default = 60 * 60 # 1 hour
param = ConfigParameter(data, "expire-threshold", int)
param.default = 24 * 60 * 60 # 1 day
+ param = ConfigParameter(data, "vacuum-enabled", bool)
+ param.default = True
+
param = ConfigParameter(data, "vacuum-interval", int)
param.default = 60 * 60 # 1 hour
Modified: trunk/mint/python/mint/expire.py
===================================================================
--- trunk/mint/python/mint/expire.py 2011-04-25 12:58:05 UTC (rev 4734)
+++ trunk/mint/python/mint/expire.py 2011-04-25 17:02:31 UTC (rev 4735)
@@ -16,8 +16,10 @@
log.debug("Expire threshold is %i seconds", self.threshold)
def run(self):
- time.sleep(0.25 * self.interval)
-
+ if self.interval >= 60 * 60:
+ time.sleep(0.25 * self.interval)
+ else:
+ time.sleep(self.interval)
super(ExpireThread, self).run()
def process(self):
Modified: trunk/mint/python/mint/vacuum.py
===================================================================
--- trunk/mint/python/mint/vacuum.py 2011-04-25 12:58:05 UTC (rev 4734)
+++ trunk/mint/python/mint/vacuum.py 2011-04-25 17:02:31 UTC (rev 4735)
@@ -13,8 +13,10 @@
log.debug("Vacuum interval is %i seconds", self.interval)
def run(self):
- time.sleep(30 * 60)
-
+ if self.interval >= 60 * 60:
+ time.sleep(0.25 * self.interval)
+ else:
+ time.sleep(self.interval)
super(VacuumThread, self).run()
def process(self):
Modified: trunk/parsley/python/parsley/config.py
===================================================================
--- trunk/parsley/python/parsley/config.py 2011-04-25 12:58:05 UTC (rev 4734)
+++ trunk/parsley/python/parsley/config.py 2011-04-25 17:02:31 UTC (rev 4735)
@@ -76,6 +76,8 @@
self.default = None
def unmarshal(self, string):
+ if self.type == bool:
+ return string not in ["False","false","0"]
return self.type(string)
class ConfigValues(dict):
13 years
r4734 - trunk/cumin/python/cumin
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-04-25 12:58:05 +0000 (Mon, 25 Apr 2011)
New Revision: 4734
Modified:
trunk/cumin/python/cumin/config.py
Log:
Remove default for --debug option, prevents debug: True working in cumin.conf
Modified: trunk/cumin/python/cumin/config.py
===================================================================
--- trunk/cumin/python/cumin/config.py 2011-04-25 12:47:34 UTC (rev 4733)
+++ trunk/cumin/python/cumin/config.py 2011-04-25 12:58:05 UTC (rev 4734)
@@ -158,11 +158,11 @@
def __init__(self):
OptionParser.__init__(self)
- self.add_option("--debug", action="store_true", default=False)
self.add_option("--init-only", action="store_true", default=False)
# Defaults for these come later from the config
# section named in --section, via apply_defaults()
+ self.add_option("--debug", action="store_true")
self.add_option("--database")
self.add_option("--brokers")
self.add_option("--log-file")
13 years
r4733 - in trunk: cumin/bin cumin/python/cumin mint/python/mint
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-04-25 12:47:34 +0000 (Mon, 25 Apr 2011)
New Revision: 4733
Modified:
trunk/cumin/bin/cumin-data
trunk/cumin/python/cumin/config.py
trunk/mint/python/mint/main.py
trunk/mint/python/mint/session.py
Log:
Allow optional restrictions on binding of QMF agents
Modified: trunk/cumin/bin/cumin-data
===================================================================
--- trunk/cumin/bin/cumin-data 2011-04-21 16:30:58 UTC (rev 4732)
+++ trunk/cumin/bin/cumin-data 2011-04-25 12:47:34 UTC (rev 4733)
@@ -54,6 +54,37 @@
return return_code, pkgs
+def process_agents(values, section_name):
+
+ return_code = 0
+ agents = set()
+ if values and len(values) > 0:
+
+ for agent_str in values.split(","):
+ agent_str = agent_str.strip()
+ if agent_str[0] == ":":
+ # Leading : indicates V1 agent label value
+ agents.add((agent_str[1:],))
+ else:
+ # V2, Looking for vendor, product, instance
+ vendor = product = instance = "*"
+ agent = agent_str.split(":")
+ if len(agent) > 3:
+ log.error("Configuration section '%s',"\
+ " agent name '%s' is badly formed"\
+ % (section_name, agent_str))
+ return_code = 1
+ break
+ if len(agent) >= 1:
+ vendor = agent[0]
+ if len(agent) >= 2:
+ product = agent[1]
+ if len(agent) == 3:
+ instance = agent[2]
+ agents.add((vendor, product, instance))
+
+ return return_code, agents
+
def main():
# Do our own simple option check so we can redirect IO early
@@ -138,17 +169,23 @@
mint.check()
mint.init()
- return_code, includes = process_classes(mint,
- values.include_classes,
- opts.section, on_empty="all")
+ # Handle QMF class binding options
+ if values.include_classes or values.exclude_classes:
+ return_code, includes = process_classes(mint,
+ values.include_classes,
+ opts.section, on_empty="all")
- return_code, excludes = process_classes(mint,
- values.exclude_classes,
- opts.section)
+ return_code, excludes = process_classes(mint,
+ values.exclude_classes,
+ opts.section)
- if values.include_classes or values.exclude_classes:
mint.qmf_classes = includes.difference(excludes)
+ # Handle agents binding option
+ if values.agents:
+ return_code, agents = process_agents(values.agents, opts.section)
+ mint.qmf_agents = agents
+
if opts.init_only or return_code:
return
Modified: trunk/cumin/python/cumin/config.py
===================================================================
--- trunk/cumin/python/cumin/config.py 2011-04-21 16:30:58 UTC (rev 4732)
+++ trunk/cumin/python/cumin/config.py 2011-04-25 12:47:34 UTC (rev 4733)
@@ -58,6 +58,7 @@
param = ConfigParameter(data, "include-classes", str)
param = ConfigParameter(data, "exclude-classes", str)
+ param = ConfigParameter(data, "agents", str)
param = ConfigParameter(data, "expire-interval", int)
param.default = 60 * 60 # 1 hour
Modified: trunk/mint/python/mint/main.py
===================================================================
--- trunk/mint/python/mint/main.py 2011-04-21 16:30:58 UTC (rev 4732)
+++ trunk/mint/python/mint/main.py 2011-04-25 12:47:34 UTC (rev 4733)
@@ -31,8 +31,10 @@
# mechanisms, according to the sasl documentation
self.sasl_mech_list = None
- # List of classes to bind. Passed on to update
- # thread and session.
+ # List of agents to bind. Referenced by session.
+ self.qmf_agents = None
+
+ # List of classes to bind. Referenced by session and update thread.
self.qmf_classes = None
def check(self):
Modified: trunk/mint/python/mint/session.py
===================================================================
--- trunk/mint/python/mint/session.py 2011-04-21 16:30:58 UTC (rev 4732)
+++ trunk/mint/python/mint/session.py 2011-04-25 12:47:34 UTC (rev 4733)
@@ -39,7 +39,20 @@
rcvHeartbeats=False,
userBindings=True)
- self.qmf_session.bindAgent("*")
+ if self.app.qmf_agents:
+ for agent in self.app.qmf_agents:
+ if len(agent) == 1:
+ self.qmf_session.bindAgent(label=agent[0])
+ log.info("Binding agent, label is %s" % agent[0])
+ else:
+ self.qmf_session.bindAgent(vendor=agent[0],
+ product=agent[1],
+ instance=agent[2])
+ log.info("Binding agent %s:%s:%s" % (agent[0],agent[1],agent[2]))
+
+ else:
+ self.qmf_session.bindAgent("*")
+ log.info("Binding all agents")
# Filter out classes we know should not be bound at this point in time
# This is to prevent confusion in log files.
13 years
r4732 - trunk/cumin/flash-slots/flare.slots/src/flare/demos
by eallen@fedoraproject.org
Author: eallen
Date: 2011-04-21 16:30:58 +0000 (Thu, 21 Apr 2011)
New Revision: 4732
Modified:
trunk/cumin/flash-slots/flare.slots/src/flare/demos/Distortions.as
trunk/cumin/flash-slots/flare.slots/src/flare/demos/Layouts.as
trunk/cumin/flash-slots/flare.slots/src/flare/demos/SlotLayout.as
trunk/cumin/flash-slots/flare.slots/src/flare/demos/SlotRenderer.as
trunk/cumin/flash-slots/flare.slots/src/flare/demos/SummaryRenderer.as
trunk/cumin/flash-slots/flare.slots/src/flare/demos/TextButton.as
Log:
Changes to the slot vis action script for:
- Spacing
- Multiple drill down
- Scrolling
- Background color
Modified: trunk/cumin/flash-slots/flare.slots/src/flare/demos/Distortions.as
===================================================================
--- trunk/cumin/flash-slots/flare.slots/src/flare/demos/Distortions.as 2011-04-21 15:20:45 UTC (rev 4731)
+++ trunk/cumin/flash-slots/flare.slots/src/flare/demos/Distortions.as 2011-04-21 16:30:58 UTC (rev 4732)
@@ -97,21 +97,49 @@
});
}
- private function make_tree(tree:Tree, n:NodeSprite):void
+ private function make_tree(tree:Tree, n:NodeSprite, rootData:Object):void
{
if (n.data.hasOwnProperty("tree")) {
var children:Data = Data.fromArray(n.data.tree);
+ var shape_info:Object = rootData.shape_info;
children.visit( function (cn:NodeSprite):Boolean {
+ if (cn.data.hasOwnProperty("back")) {
+ if (cn.data.back) {
+ tree.back = true;
+ }
+ }
tree.addChild(n, cn);
- cn.shape = cn.data.shape;
- var color:Array = cn.data.color;
- cn.fillColor = Colors.rgba(color[0]*255, color[1]*255, color[2]*255);
- if (cn.data.hasOwnProperty("state")) {
- cn.renderer = new SlotRenderer(cn.data.state);
+ if (cn.data.hasOwnProperty("category")) {
+ cn.shape = shape_info[cn.data.category]["shape"];
+ try {
+ cn.fillColor = Colors.rgba(shape_info[cn.data.category]["color"][0]*255,
+ shape_info[cn.data.category]["color"][1]*255,
+ shape_info[cn.data.category]["color"][2]*255);
+ } catch (e:Error) {
+ cn.fillColor = Colors.rgba(shape_info["Unknown"]["color"][0]*255,
+ shape_info["Unknown"]["color"][1]*255,
+ shape_info["Unknown"]["color"][2]*255);
+ }
+ cn.lineColor = cn.fillColor;
+ cn.data.orgLineColor = cn.lineColor;
+ cn.fillAlpha = 1;
+ cn.lineAlpha = 1;
}
- make_tree(tree, cn);
+ if (cn.data.hasOwnProperty("count")) {
+ cn.renderer = summaryRenderer;
+ cn.data.percent = cn.data.count / cn.parentNode.data.slots;
+ cn.lineWidth = 1;
+ } else if (cn.data.hasOwnProperty("state")) {
+ cn.renderer = slotRenderer;
+ } else if (cn.data.level == 1) {
+ cn.renderer = groupRenderer;
+ } else {
+ cn.shape = null;
+ }
+ make_tree(tree, cn, rootData);
return false
});
+ delete n.data.tree;
}
}
Modified: trunk/cumin/flash-slots/flare.slots/src/flare/demos/Layouts.as
===================================================================
--- trunk/cumin/flash-slots/flare.slots/src/flare/demos/Layouts.as 2011-04-21 15:20:45 UTC (rev 4731)
+++ trunk/cumin/flash-slots/flare.slots/src/flare/demos/Layouts.as 2011-04-21 16:30:58 UTC (rev 4732)
@@ -28,7 +28,7 @@
import flash.geom.Rectangle;
import flash.net.URLLoader;
- import mx.controls.scrollClasses.ScrollBar;
+ import mx.controls.VScrollBar;
/**
* Demo showcasing a number of tree and graph layout algorithms.
@@ -38,7 +38,7 @@
private var vis:Visualization;
private var os:OperatorSwitch;
private var shape:String = null;
- private var sb:ScrollBar = null;
+ private var sb:VScrollBar = null;
private var lastSequence:Number = -1;
private var opt:Array;
@@ -355,28 +355,13 @@
} else {
backButton.hide();
}
-
+
vis.data = data;
sizeMatters(data);
nodeEncoder.operate();
edgeEncoder.operate();
+ vis.opaqueBackground = 0xFFFFFF;
vis.update();
-
- if (!sb) {
- sb = new ScrollBar();
- sb.width = 40;
- sb.height = this.stage.stageHeight;
- sb.x = this.stage.stageWidth - 40;
- sb.y = 0;
- sb.pageSize = 400;
- sb.minScrollPosition = 0;
- sb.maxScrollPosition = this.stage.stageHeight;
- sb.pageScrollSize = 0;
- sb.visible = true;
- sb.enabled = true;
- this.stage.addChild(sb);
- }
-
}
}
private function tipOver(evt:ToolTipEvent):void {
@@ -401,6 +386,7 @@
{
if (vis) {
vis.bounds = mainBounds(bounds);
+ vis.opaqueBackground = 0xFFFFFF;
vis.update();
}
}
Modified: trunk/cumin/flash-slots/flare.slots/src/flare/demos/SlotLayout.as
===================================================================
--- trunk/cumin/flash-slots/flare.slots/src/flare/demos/SlotLayout.as 2011-04-21 15:20:45 UTC (rev 4731)
+++ trunk/cumin/flash-slots/flare.slots/src/flare/demos/SlotLayout.as 2011-04-21 16:30:58 UTC (rev 4732)
@@ -91,7 +91,7 @@
if (visualization.tree.back) {
backButtonHeight = 11;
}
- var dr:Number = Math.max(a[0]/bounds.width, a[1]/(bounds.height - backButtonHeight));
+ var dr:Number = Math.max(a[0]/(bounds.width), a[1]/(bounds.height - backButtonHeight));
var scale:Number = fitInBounds ? 0.99/dr : 1;
_anchor.x = Math.max((bounds.width - (a[0] * scale)) / 2, 0);
_anchor.y = Math.max((bounds.height - (a[1] * scale)) / 2, backButtonHeight);
@@ -171,9 +171,6 @@
}
list.push(c);
}
- if (list.length > 2) {
- var z:Number = 1;
- }
// now sort the child list and perform packing
//if (_sort) _sort.sort(list);
for (i=0; i<list.length; ++i) {
@@ -215,7 +212,7 @@
if (maxLeaves == 0) {
cols = Math.floor(Math.sqrt(N));
} else {
- cols = Math.min(4, N);
+ cols = Math.min(2, N);
expandable = true;
}
rows = Math.floor(N/cols);
@@ -274,10 +271,9 @@
if (i < N) {
cn = nodes[i];
cn.x = colX;
- if (expandable && (cols == 4)) {
- fitInBounds = false;
- cn.w = 180;
- cn.x = 200 * curCol;
+ if (expandable) {
+ cn.w = 360;
+ cn.x = 390 * curCol;
}
cn.y = rowY;
updateBounds(cn, _b);
@@ -306,7 +302,7 @@
_b.top = 0;
return [_b.width, _b.height];
}
-
+
/** Update the bounding box around the nodes. */
private static function updateBounds(c:ChainNode, b:Rectangle):void
{
@@ -344,8 +340,6 @@
if (c.data.name == "slot_info") {
c.data.ppercent = ppercent;
c.data.order = order;
- var tw:Number = c.size * 16 * 6;
- c.x = n.x + (c.data.ppercent * tw) + (c.data.order * 1);
ppercent += c.data.percent;
order += 1;
}
@@ -371,9 +365,9 @@
t = p.data.name;
tf.text = t;
var w:Number = tf.textWidth + tformat.indent;
- var size:Number = Math.min(p.width, 180);
+ var size:Number = Math.min(p.width, 380);
if (p.parentNode.childDegree == 1) {
- size = 390;
+ size = 760;
}
var str:String = tf.text;
while ((w > size) && (str.length > 0)) {
Modified: trunk/cumin/flash-slots/flare.slots/src/flare/demos/SlotRenderer.as
===================================================================
--- trunk/cumin/flash-slots/flare.slots/src/flare/demos/SlotRenderer.as 2011-04-21 15:20:45 UTC (rev 4731)
+++ trunk/cumin/flash-slots/flare.slots/src/flare/demos/SlotRenderer.as 2011-04-21 16:30:58 UTC (rev 4732)
@@ -17,26 +17,10 @@
}
public override function render(d:DataSprite):void
{
-/*
- d.graphics.lineStyle(2, 0);
- d.graphics.beginFill(0, 1);
- d.graphics.drawRect(0,0,100,100);
- return;
- if (flash.system.Capabilities.isDebugger) {
- var outputText:TextField = new TextField();
- outputText.x = 0;
- outputText.y = 0;
- outputText.background = true;
- outputText.autoSize = TextFieldAutoSize.LEFT;
- outputText.appendText("Made it to: ");
- outputText.appendText("slot render.\n");
- d.addChild(outputText);
- }
-*/
var g:Graphics = d.graphics;
g.clear();
- var size:Number = d.size * defaultSize;
+ var size:Number = d.size * 2 * defaultSize;
var color:Array = d.data.color;
var baseColor:Number = d.fillColor;
var lineColor:Number = d.lineColor & 0xffffff;
@@ -47,8 +31,8 @@
x = 0;
y = 0;
- w = size * 2;
- h = size * 2;
+ w = size;
+ h = size;
g.drawRect(x, y, w, h);
var shape:String = d.shape;
Modified: trunk/cumin/flash-slots/flare.slots/src/flare/demos/SummaryRenderer.as
===================================================================
--- trunk/cumin/flash-slots/flare.slots/src/flare/demos/SummaryRenderer.as 2011-04-21 15:20:45 UTC (rev 4731)
+++ trunk/cumin/flash-slots/flare.slots/src/flare/demos/SummaryRenderer.as 2011-04-21 16:30:58 UTC (rev 4732)
@@ -23,7 +23,7 @@
var lineColor:Number = d.lineColor & 0xffffff;
var x:Number, y:Number, w:Number, h:Number;
- var tw:Number = size * 16;
+ var tw:Number = (size * 20 * 2);
var n:NodeSprite = d as NodeSprite;
var parent_x:Number = n.parentNode.x;
// a normal slot
@@ -36,24 +36,26 @@
g.beginFill(0xffffff, 1);
+ // draw a rect so the control has the proper width and height
+ // for mouse-over events
g.lineStyle(1, 0xffffff, 1);
g.drawRect(x, y, w, h);
-
g.lineStyle(1, lineColor, 1);
var currX:Number = x;
var currY:Number = y;
+ var blockSize:Number = 4;
for (var i:Number = 0; i<d.data.count; i++) {
- if ((currX + 3) > w) {
+ if ((currX + blockSize) > w) {
currX = 0;
- currY += 4;
+ currY += (blockSize + 1);
if (currY > h) {
break;
}
}
- g.drawRect(currX, currY, 3, 3);
- currX += 4;
+ g.drawRect(currX, currY, blockSize, blockSize);
+ currX += (blockSize + 1);
}
g.endFill();
return;
Modified: trunk/cumin/flash-slots/flare.slots/src/flare/demos/TextButton.as
===================================================================
--- trunk/cumin/flash-slots/flare.slots/src/flare/demos/TextButton.as 2011-04-21 15:20:45 UTC (rev 4731)
+++ trunk/cumin/flash-slots/flare.slots/src/flare/demos/TextButton.as 2011-04-21 16:30:58 UTC (rev 4732)
@@ -49,12 +49,12 @@
visible = false;
}
public function show():void {
- x = 300;
+ x = 0;
visible = true;
}
private function getBitmapFilter():BitmapFilter {
- var color:Number = 0x000000;
+ var color:Number = 0x8c81c4;
var angle:Number = 45;
var alpha:Number = 0.4;
var blurX:Number = 2;
13 years
r4731 - in trunk: cumin/bin cumin/python/cumin mint/python/mint
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-04-21 15:20:45 +0000 (Thu, 21 Apr 2011)
New Revision: 4731
Modified:
trunk/cumin/bin/cumin-data
trunk/cumin/bin/cumin-web
trunk/cumin/python/cumin/main.py
trunk/cumin/python/cumin/session.py
trunk/mint/python/mint/main.py
trunk/mint/python/mint/session.py
trunk/mint/python/mint/update.py
Log:
Filter deletion of database objects on agent create/delete by the list of
bound QMF classes in a cumin-data instance.
Also reference sasl_mech_list through self.app in session.py files (minor)
BZ698712
Modified: trunk/cumin/bin/cumin-data
===================================================================
--- trunk/cumin/bin/cumin-data 2011-04-21 13:32:15 UTC (rev 4730)
+++ trunk/cumin/bin/cumin-data 2011-04-21 15:20:45 UTC (rev 4731)
@@ -125,7 +125,8 @@
mint = Mint(model_dir, broker_uris, opts.database)
- mint.sasl_mech_list = values.sasl_mech_list
+ if type(values.sasl_mech_list) == str:
+ mint.sasl_mech_list = values.sasl_mech_list.upper()
mint.print_event_level = opts.print_events
@@ -146,7 +147,7 @@
opts.section)
if values.include_classes or values.exclude_classes:
- mint.session.qmf_classes = includes.difference(excludes)
+ mint.qmf_classes = includes.difference(excludes)
if opts.init_only or return_code:
return
Modified: trunk/cumin/bin/cumin-web
===================================================================
--- trunk/cumin/bin/cumin-web 2011-04-21 13:32:15 UTC (rev 4730)
+++ trunk/cumin/bin/cumin-web 2011-04-21 15:20:45 UTC (rev 4731)
@@ -85,7 +85,9 @@
cumin = Cumin(config.get_home(), broker_uris, opts.database,
opts.host, opts.port, values.persona)
- cumin.sasl_mech_list = values.sasl_mech_list
+ if type(values.sasl_mech_list) == str:
+ cumin.sasl_mech_list = values.sasl_mech_list.upper()
+
cumin.debug = opts.debug
cumin.user = values.user
cumin.update_interval = values.update_interval
Modified: trunk/cumin/python/cumin/main.py
===================================================================
--- trunk/cumin/python/cumin/main.py 2011-04-21 13:32:15 UTC (rev 4730)
+++ trunk/cumin/python/cumin/main.py 2011-04-21 15:20:45 UTC (rev 4731)
@@ -177,10 +177,6 @@
def start(self):
log.info("Starting %s", self)
- # Late binding. sasl_mech_list is not needed until
- # session is started.
- if type(self.sasl_mech_list) == str:
- self.session.sasl_mech_list = self.sasl_mech_list.upper()
self.session.start()
self.server.start()
Modified: trunk/cumin/python/cumin/session.py
===================================================================
--- trunk/cumin/python/cumin/session.py 2011-04-21 13:32:15 UTC (rev 4730)
+++ trunk/cumin/python/cumin/session.py 2011-04-21 15:20:45 UTC (rev 4731)
@@ -11,7 +11,6 @@
def __init__(self, app, broker_uris):
self.app = app
self.broker_uris = broker_uris
- self.sasl_mech_list = None
self.qmf_session = None
self.qmf_brokers = list()
@@ -23,11 +22,11 @@
self.lock = Lock()
def add_broker(self, uri):
- log.info("Adding QMF broker at %s", uri)
+ log.info("Adding QMF broker at %s with mech_list %s", uri, str(self.app.sasl_mech_list))
assert self.qmf_session
- qmf_broker = self.qmf_session.addBroker(uri,mechanisms=self.sasl_mech_list)
+ qmf_broker = self.qmf_session.addBroker(uri,mechanisms=self.app.sasl_mech_list)
self.qmf_brokers.append(qmf_broker)
Modified: trunk/mint/python/mint/main.py
===================================================================
--- trunk/mint/python/mint/main.py 2011-04-21 13:32:15 UTC (rev 4730)
+++ trunk/mint/python/mint/main.py 2011-04-21 15:20:45 UTC (rev 4731)
@@ -31,6 +31,10 @@
# mechanisms, according to the sasl documentation
self.sasl_mech_list = None
+ # List of classes to bind. Passed on to update
+ # thread and session.
+ self.qmf_classes = None
+
def check(self):
log.info("Checking %s", self)
@@ -60,10 +64,6 @@
self.update_thread.start()
- # Late binding. sasl_mech_list is not needed until
- # session is started.
- if type(self.sasl_mech_list) == str:
- self.session.sasl_mech_list = self.sasl_mech_list.upper()
self.session.start()
if self.expire_enabled:
Modified: trunk/mint/python/mint/session.py
===================================================================
--- trunk/mint/python/mint/session.py 2011-04-21 13:32:15 UTC (rev 4730)
+++ trunk/mint/python/mint/session.py 2011-04-21 15:20:45 UTC (rev 4731)
@@ -9,21 +9,16 @@
def __init__(self, app, broker_uris):
self.app = app
self.broker_uris = broker_uris
- self.sasl_mech_list = None
self.qmf_session = None
self.qmf_brokers = list()
- # This will become a sequence if
- # class binding is specifed in configuration
- self.qmf_classes = None
-
def add_broker(self, uri):
- log.info("Adding QMF broker at %s", uri)
+ log.info("Adding QMF broker at %s with mech_list %s", uri, str(self.app.sasl_mech_list))
assert self.qmf_session
- qmf_broker = self.qmf_session.addBroker(uri, mechanisms=self.sasl_mech_list)
+ qmf_broker = self.qmf_session.addBroker(uri, mechanisms=self.app.sasl_mech_list)
self.qmf_brokers.append(qmf_broker)
def check(self):
@@ -51,8 +46,8 @@
package_filter = ["com.redhat.cumin", "com.redhat.cumin.grid"]
# Handle bind by class
- if self.qmf_classes:
- for cls in self.qmf_classes:
+ if self.app.qmf_classes:
+ for cls in self.app.qmf_classes:
pname = cls._package._name
cname = cls._name
if pname not in package_filter:
Modified: trunk/mint/python/mint/update.py
===================================================================
--- trunk/mint/python/mint/update.py 2011-04-21 13:32:15 UTC (rev 4730)
+++ trunk/mint/python/mint/update.py 2011-04-21 15:20:45 UTC (rev 4731)
@@ -184,7 +184,7 @@
log.debug("Processing %s", self)
try:
- self.do_process(thread.cursor, thread.stats)
+ self.do_process(thread.cursor, thread.stats, thread.app.qmf_classes)
thread.conn.commit()
except UpdateDropped:
@@ -205,7 +205,7 @@
if thread.halt_on_error:
raise
- def do_process(self, cursor, stats):
+ def do_process(self, cursor, stats, bound_classes):
raise Exception("Not implemented")
def __repr__(self):
@@ -217,7 +217,7 @@
self.qmf_object = qmf_object
- def do_process(self, cursor, stats):
+ def do_process(self, cursor, stats, bound_classes):
cls = self.get_class()
agent_id = self.get_agent_id()
object_id = self.get_object_id()
@@ -574,7 +574,7 @@
def get_agent_id(self):
return make_agent_id(self.qmf_agent)
- def do_process(self, cursor, stats):
+ def do_process(self, cursor, stats, bound_classes):
agent_id = self.get_agent_id()
try:
@@ -584,7 +584,7 @@
stats.agents_created += 1
- self.delete_agent_objects(cursor, stats, agent)
+ self.delete_agent_objects(cursor, stats, agent, bound_classes)
return
@@ -595,22 +595,26 @@
stats.agents_updated += 1
- def delete_agent_objects(self, cursor, stats, agent):
- for pkg in self.model._packages:
- for cls in pkg._classes:
- if cls._storage == "none":
- continue
+ def delete_agent_objects(self, cursor, stats, agent, bound_classes):
- if cls is self.model.com_redhat_grid.Collector:
- continue
-
+ def loop_body(cls):
+ if cls._storage != "none" and cls is not self.model.com_redhat_grid.Collector:
count = cls.delete_selection(cursor, _qmf_agent_id=agent.id)
-
stats.objects_deleted += count
#stats.objects_deleted_by_class[cls] += count
-
cursor.connection.commit()
+ if bound_classes:
+ log.debug("Delete agent objects by bound classes " + str(bound_classes))
+ for cls in bound_classes:
+ loop_body(cls)
+ else:
+ # We bound all classes. Loop over model
+ log.debug("Delete agent objects, all classes")
+ for pkg in self.model._packages:
+ for cls in pkg._classes:
+ loop_body(cls)
+
def __repr__(self):
name = self.__class__.__name__
agent_id = self.get_agent_id()
@@ -618,7 +622,7 @@
return "%s(%s)" % (name, agent_id)
class AgentDelete(AgentUpdate):
- def do_process(self, cursor, stats):
+ def do_process(self, cursor, stats, bound_classes):
agent_id = self.get_agent_id()
try:
@@ -630,7 +634,7 @@
stats.agents_deleted += 1
- self.delete_agent_objects(cursor, stats, agent)
+ self.delete_agent_objects(cursor, stats, agent, bound_classes)
class UpdateDropped(Exception):
pass
13 years
r4730 - in trunk/cumin: python/cumin/grid resources
by eallen@fedoraproject.org
Author: eallen
Date: 2011-04-21 13:32:15 +0000 (Thu, 21 Apr 2011)
New Revision: 4730
Modified:
trunk/cumin/python/cumin/grid/slotvis.py
trunk/cumin/resources/slots.swf
Log:
Better fix for BZ 695820 - Found a missing background color setting in flash and set it to white. Also limited the height of the flash chart to 4K which is apparently an internal limit to flash.
Modified: trunk/cumin/python/cumin/grid/slotvis.py
===================================================================
--- trunk/cumin/python/cumin/grid/slotvis.py 2011-04-21 13:28:51 UTC (rev 4729)
+++ trunk/cumin/python/cumin/grid/slotvis.py 2011-04-21 13:32:15 UTC (rev 4730)
@@ -168,7 +168,7 @@
cols = int(width / slot_size) * 4
rows = int(math.ceil(count / cols))
- return max(rows * slot_size, width)
+ return min(max(rows * slot_size, width), 4095)
def render_fullpageable(self, session):
return self.fullpageable and "fullpageable" or ""
Modified: trunk/cumin/resources/slots.swf
===================================================================
(Binary files differ)
13 years
r4729 - trunk/cumin/python/cumin
by croberts@fedoraproject.org
Author: croberts
Date: 2011-04-21 13:28:51 +0000 (Thu, 21 Apr 2011)
New Revision: 4729
Modified:
trunk/cumin/python/cumin/model.py
Log:
Small refactoring to eliminate several lines of code and produce something that is a bit easier to read.
Modified: trunk/cumin/python/cumin/model.py
===================================================================
--- trunk/cumin/python/cumin/model.py 2011-04-20 22:01:21 UTC (rev 4728)
+++ trunk/cumin/python/cumin/model.py 2011-04-21 13:28:51 UTC (rev 4729)
@@ -714,6 +714,10 @@
prop.title = "Job Universe"
prop.writable = False
prop.renderer = prop.render_universe
+
+ prop = DateAdProperty(self, "JobStartDate")
+ prop.group = "Main"
+ prop.writable = False
### Condor Info Group
prop = AdProperty(self, "CondorVersion")
@@ -807,76 +811,34 @@
prop.description = "When the job was submitted"
prop.group = "Dates"
prop.writable = False
+
+ #these properties are undecorated unwritable properties
+ unwritableProps = ("LastVacateTime", "JobCurrentStartDate", "JobLastStartDate",
+ "LastSuspensionTime", "ShadowBday", "LastJobLeaseRenewal", "EnteredCurrentStatus",
+ "CommittedTime", "LastMatchTime", "ScheddBday", "LastRejMatchTime")
- prop = DateAdProperty(self, "LastVacateTime")
- prop.group = "Dates"
- prop.writable = False
-
- prop = DateAdProperty(self, "JobStartDate")
- prop.group = "Main"
- prop.writable = False
-
- prop = DateAdProperty(self, "JobCurrentStartDate")
- prop.group = "Dates"
- prop.writable = False
-
- prop = DateAdProperty(self, "JobLastStartDate")
- prop.group = "Dates"
- prop.writable = False
-
- prop = DateAdProperty(self, "LastSuspensionTime")
- prop.group = "Dates"
- prop.writable = False
-
- prop = DateAdProperty(self, "ShadowBday")
- prop.group = "Dates"
- prop.writable = False
-
- prop = DateAdProperty(self, "LastJobLeaseRenewal")
- prop.group = "Dates"
- prop.writable = False
-
- prop = DateAdProperty(self, "EnteredCurrentStatus")
- prop.group = "Dates"
- prop.writable = False
-
- prop = DateAdProperty(self, "CommittedTime")
- prop.group = "Dates"
- prop.writable = False
-
- prop = DateAdProperty(self, "LastMatchTime")
- prop.group = "Dates"
- prop.writable = False
-
- prop = DateAdProperty(self, "ScheddBday")
- prop.group = "Dates"
- prop.writable = False
-
- prop = DateAdProperty(self, "LastRejMatchTime")
- prop.group = "Dates"
- prop.writable = False
-
+ for currentProp in unwritableProps:
+ prop = DateAdProperty(self, currentProp)
+ prop.group = "Dates"
+ prop.writable = False
+
# other
- prop = AdProperty(self, "User")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "MinHosts")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "RemoteUserCpu")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "DiskUsage")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "ImageSize")
- prop.group = "Other"
- prop.writable = False
-
+ #all of these properties are unwritable and require no description
+ unwritableProps = ("User", "MinHosts", "RemoteUserCpu", "DiskUsage", "ImageSize", "RequestMemory",
+ "RequestDisk", "NumShadowStarts", "NumJobStarts", "AutoClusterId",
+ "NumJobMatches", "DiskUsage_RAW", "JobRunCount", "RemoteSlotID",
+ "OrigMaxHosts", "TransferFiles", "RemoteSysCpu", "ImageSize_RAW",
+ "CurrentHosts", "ClaimId", "PublicClaimId", "StartIpAddr", "StartdPrincipal",
+ "RemoteHost", "NumShadowExceptions", "LastRemoteHost", "LastPuclicClaimId",
+ "BytesRecvd", "RemoteWallClockTime", "BytesSent", "CumulativeSlotTime")
+
+
+ for currentProp in unwritableProps:
+ prop = AdProperty(self, currentProp)
+ prop.group = "Other"
+ prop.writable = False
+
+
prop = AdProperty(self, "RequestMemory")
prop.description = "Required for scheduling to partitionable slots."
prop.group = "Other"
@@ -885,102 +847,6 @@
prop.description = "Required for scheduling to partitionable slots."
prop.group = "Other"
- prop = AdProperty(self, "NumShadowStarts")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "NumJobStarts")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "AutoClusterId")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "NumJobMatches")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "DiskUsage_RAW")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "JobRunCount")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "RemoteSlotID")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "OrigMaxHosts")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "TransferFiles")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "RemoteSysCpu")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "ImageSize_RAW")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "CurrentHosts")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "ClaimId")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "PublicClaimId")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "StartdIpAddr")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "StartdPrincipal")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "RemoteHost")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "NumShadowExceptions")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "LastRemoteHost")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "LastPublicClaimId")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "BytesRecvd")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "RemoteWallClockTime")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "BytesSent")
- prop.group = "Other"
- prop.writable = False
-
- prop = AdProperty(self, "CumulativeSlotTime")
- prop.group = "Other"
- prop.writable = False
-
class JobStatusProperty(AdProperty):
def render_status(self, session, status):
return JobStatusInfo.get_status_string(status)
13 years
r4728 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2011-04-20 22:01:21 +0000 (Wed, 20 Apr 2011)
New Revision: 4728
Modified:
trunk/cumin/python/cumin/grid/job.py
Log:
Another whack at fixing BZ https://bugzilla.redhat.com/show_bug.cgi?id=696635 It was decided to NOT show the edit button for completed jobs, so we have built some extra logic into the render method for that button.
Modified: trunk/cumin/python/cumin/grid/job.py
===================================================================
--- trunk/cumin/python/cumin/grid/job.py 2011-04-20 13:23:44 UTC (rev 4727)
+++ trunk/cumin/python/cumin/grid/job.py 2011-04-20 22:01:21 UTC (rev 4728)
@@ -576,7 +576,17 @@
def render_edit_button(self, session):
_, error = self.do_get_items(session)
- return not error and self.edit_button.render(session) or ""
+ render = True
+ #We check the JobStatus to see if the job is already completed.
+ #If it is, we do not want to show the "edit" button
+ for item in _:
+ if "property" in item:
+ if item["name"] == "JobStatus":
+ status = item["value"]
+ if JobStatusInfo.get_status_string(status) == "Completed":
+ render = False
+ break
+ return render and not error and self.edit_button.render(session) or ""
def render_title(self, session):
return "Attributes"
13 years
r4727 - in trunk/cumin: model python/cumin/messaging
by eallen@fedoraproject.org
Author: eallen
Date: 2011-04-20 13:23:44 +0000 (Wed, 20 Apr 2011)
New Revision: 4727
Modified:
trunk/cumin/model/rosemary.xml
trunk/cumin/python/cumin/messaging/connection.py
Log:
Override the RemoteProcessName column title in the xml file instead of the code. This fixes a problem with the search box on the Connections page.
Modified: trunk/cumin/model/rosemary.xml
===================================================================
--- trunk/cumin/model/rosemary.xml 2011-04-20 12:59:54 UTC (rev 4726)
+++ trunk/cumin/model/rosemary.xml 2011-04-20 13:23:44 UTC (rev 4727)
@@ -87,6 +87,9 @@
<title>%(address)s</title>
</object>
+ <property name="remoteProcessName">
+ <title>Process (PID)</title>
+ </property>
<property name="remotePid">
<title>Process ID</title>
<!-- value -->
Modified: trunk/cumin/python/cumin/messaging/connection.py
===================================================================
--- trunk/cumin/python/cumin/messaging/connection.py 2011-04-20 12:59:54 UTC (rev 4726)
+++ trunk/cumin/python/cumin/messaging/connection.py 2011-04-20 13:23:44 UTC (rev 4727)
@@ -118,9 +118,6 @@
except KeyError:
self.pid_field = ObjectSqlField(self.table.adapter, self.pid_attr)
- def render_header_content(self, session):
- return "Process (PID)"
-
def render_cell_content(self, session, record):
args = (record[self.field.index], record[self.pid_field.index] or 0)
return "%s (%i)" % args
13 years