Author: croberts
Date: 2013-02-13 20:25:56 +0000 (Wed, 13 Feb 2013)
New Revision: 5704
Modified:
branches/elephant/cumin/python/cumin/gridhadoop/datanode.py
branches/elephant/cumin/python/cumin/gridhadoop/hadoop.py
branches/elephant/cumin/python/cumin/gridhadoop/jobtracker.py
branches/elephant/cumin/python/cumin/gridhadoop/namenode.py
branches/elephant/cumin/python/cumin/gridhadoop/tasktracker.py
Log:
Deleting/stopping multiple nodes will no longer result in multiple notification banner
messages. Refactored the ObjectSelectorTask's invoke to expect and act on a list as a
whole.
Modified: branches/elephant/cumin/python/cumin/gridhadoop/datanode.py
===================================================================
--- branches/elephant/cumin/python/cumin/gridhadoop/datanode.py 2013-02-13 19:40:25 UTC
(rev 5703)
+++ branches/elephant/cumin/python/cumin/gridhadoop/datanode.py 2013-02-13 20:25:56 UTC
(rev 5704)
@@ -80,10 +80,10 @@
self.form = DataNodeDeleteForm(app, self.name, self, cls)
self.invoc = None
- def do_invoke(self, invoc, id, args):
+ def do_invoke(self, invoc, ids, args):
self.invoc = invoc
(hadoophost) = args
- self.app.remote.stop_data_node(hadoophost, [float(id)], invoc.make_callback())
+ self.app.remote.stop_data_node(hadoophost, ids, invoc.make_callback())
def get_title(self, session):
return "Remove data nodes"
@@ -229,7 +229,7 @@
class DataNodeObjectView(HadoopObjectView):
def add_details_tab(self):
- self.add_tab(DataNodeDetails(self.app, self.name + ".details",
self.object))
+ self.add_tab(DataNodeDetails(self.app, "details", self.object))
def render_title(self, session):
obj = self.object.get(session)
Modified: branches/elephant/cumin/python/cumin/gridhadoop/hadoop.py
===================================================================
--- branches/elephant/cumin/python/cumin/gridhadoop/hadoop.py 2013-02-13 19:40:25 UTC (rev
5703)
+++ branches/elephant/cumin/python/cumin/gridhadoop/hadoop.py 2013-02-13 20:25:56 UTC (rev
5704)
@@ -272,4 +272,14 @@
def enter(self, session):
form_session = super(HadoopNodeDeleteTask, self).enter(session)
self.form.hadoophost.set(form_session,
self.module.frame.children_by_name[self.module.frame.name +
".ghschedframe"].host.get(session))
- return form_session
\ No newline at end of file
+ return form_session
+
+ def invoke(self, session, selection, *args):
+ invoc = self.start(session, selection)
+
+ try:
+ self.do_invoke(invoc, selection, *args)
+ except Exception, e:
+ invoc.exception = e
+ invoc.status = invoc.FAILED
+ invoc.end()
Modified: branches/elephant/cumin/python/cumin/gridhadoop/jobtracker.py
===================================================================
--- branches/elephant/cumin/python/cumin/gridhadoop/jobtracker.py 2013-02-13 19:40:25 UTC
(rev 5703)
+++ branches/elephant/cumin/python/cumin/gridhadoop/jobtracker.py 2013-02-13 20:25:56 UTC
(rev 5704)
@@ -85,10 +85,10 @@
self.form = JobTrackerDeleteForm(app, self.name, self, cls)
self.invoc = None
- def do_invoke(self, invoc, id, args):
+ def do_invoke(self, invoc, ids, args):
self.invoc = invoc
(hadoophost) = args
- self.app.remote.stop_job_tracker(hadoophost, [float(id)], invoc.make_callback())
+ self.app.remote.stop_job_tracker(hadoophost, ids, invoc.make_callback())
def get_title(self, session):
return "Remove job trackers"
Modified: branches/elephant/cumin/python/cumin/gridhadoop/namenode.py
===================================================================
--- branches/elephant/cumin/python/cumin/gridhadoop/namenode.py 2013-02-13 19:40:25 UTC
(rev 5703)
+++ branches/elephant/cumin/python/cumin/gridhadoop/namenode.py 2013-02-13 20:25:56 UTC
(rev 5704)
@@ -147,10 +147,10 @@
self.form = NameNodeDeleteForm(app, self.name, self, cls)
self.invoc = None
- def do_invoke(self, invoc, id, args):
+ def do_invoke(self, invoc, ids, args):
self.invoc = invoc
(hadoophost) = args
- self.app.remote.stop_name_node(hadoophost, [float(id)], invoc.make_callback())
+ self.app.remote.stop_name_node(hadoophost, ids, invoc.make_callback())
def get_title(self, session):
return "Remove name nodes"
Modified: branches/elephant/cumin/python/cumin/gridhadoop/tasktracker.py
===================================================================
--- branches/elephant/cumin/python/cumin/gridhadoop/tasktracker.py 2013-02-13 19:40:25 UTC
(rev 5703)
+++ branches/elephant/cumin/python/cumin/gridhadoop/tasktracker.py 2013-02-13 20:25:56 UTC
(rev 5704)
@@ -80,10 +80,10 @@
self.form = TaskTrackerDeleteForm(app, self.name, self, cls)
self.invoc = None
- def do_invoke(self, invoc, id, args):
+ def do_invoke(self, invoc, ids, args):
self.invoc = invoc
(hadoophost) = args
- self.app.remote.stop_task_tracker(hadoophost, [float(id)], invoc.make_callback())
+ self.app.remote.stop_task_tracker(hadoophost, ids, invoc.make_callback())
def get_title(self, session):
return "Remove task trackers"