Author: croberts
Date: 2012-12-10 21:57:46 +0000 (Mon, 10 Dec 2012)
New Revision: 5574
Added:
branches/elephant/cumin/python/cumin/gridhadoop/
Removed:
branches/elephant/cumin/python/cumin/grid-hadoop/
Modified:
branches/elephant/cumin/model/access/persona.xml
branches/elephant/cumin/python/cumin/gridhadoop/hadoop.py
branches/elephant/cumin/python/cumin/gridhadoop/main.py
Log:
Renaming module from grid-hadoop to gridhadoop....hyphens in module names might not be a
great idea
Modified: branches/elephant/cumin/model/access/persona.xml
===================================================================
--- branches/elephant/cumin/model/access/persona.xml 2012-12-10 20:53:37 UTC (rev 5573)
+++ branches/elephant/cumin/model/access/persona.xml 2012-12-10 21:57:46 UTC (rev 5574)
@@ -29,7 +29,7 @@
<Module name="grid"/>
<Module name="inventory"/>
<Module name="usergrid"/>
- <Module name="grid-hadoop"/>
+ <Module name="gridhadoop"/>
<GroupAccess name="nogroup">
<MainPage name="login.html"/>
@@ -51,7 +51,7 @@
<Module name="account"/>
<Module name="configuration"/>
<Module name="inventory"/>
- <Module name="grid-hadoop"/>
+ <Module name="gridhadoop"/>
<GroupAccess name="nogroup">
<MainPage name="login.html"/>
Modified: branches/elephant/cumin/python/cumin/gridhadoop/hadoop.py
===================================================================
--- branches/elephant/cumin/python/cumin/grid-hadoop/hadoop.py 2012-12-10 20:53:37 UTC
(rev 5573)
+++ branches/elephant/cumin/python/cumin/gridhadoop/hadoop.py 2012-12-10 21:57:46 UTC (rev
5574)
@@ -1,7 +1,7 @@
from operator import itemgetter
from cumin.objectselector import ObjectSelector, ObjectLinkColumn, ObjectTable,
ObjectTableColumn, ObjectQmfTable
-from cumin.objectframe import ObjectFrame
+from cumin.objectframe import ObjectFrame, ObjectFrameTaskForm
from cumin.stat import StatSet, StatFlashChart
from cumin.formats import fmt_bytes, fmt_datetime
from cumin.model import CuminStatistic
@@ -9,6 +9,7 @@
from cumin.sqladapter import ObjectSqlAdapter, ObjectSqlField
from cumin.util import *
from cumin.qmfadapter import ObjectQmfAdapter
+from cumin.task import Task, TaskLink
from sage.wallaby.wallabyoperations import WallabyOperations, WBTypes
from sage.util import MethodResult
@@ -35,6 +36,10 @@
self.add_search_filter(self.table.loc_col)
self.table.adapter = HadoopAdapter(app, cls, None)
+
+ #link = TaskLink(app, "nameNode_create",
app.gridhadoop.nameNode_create)
+ #self.links.add_child(link)
+
self.enable_csv_export()
@@ -236,4 +241,33 @@
self.add_column(self.status_col)
self.add_column(self.uptime_col)
self.add_column(self.owner_col)
-
\ No newline at end of file
+
+
+class NameNodeCreate(Task):
+ def __init__(self, app):
+ super(NameNodeCreate, self).__init__(app)
+
+ self.form = NameNodeCreateForm(app, "namenodecreateform", self)
+
+ def get_title(self, session, scheduler):
+ return "Create a name node"
+
+
+class NameNodeCreateForm(ObjectFrameTaskForm):
+ def __init__(self, app, name, task):
+ super(NameNodeCreateForm, self).__init__(app, name, task)
+
+ def process_display(self, session):
+ self.scheduler.validate(session)
+
+ def process_submit(self, session):
+ self.validate(session)
+
+ attrs = self.attrs.parse_attributes(session)
+
+ if not self.errors.get(session):
+ location = self.location.get(session)
+
+ print "Here is where I'd do the work"
+ self.task.exit_with_redirect(session, scheduler)
+
\ No newline at end of file
Modified: branches/elephant/cumin/python/cumin/gridhadoop/main.py
===================================================================
--- branches/elephant/cumin/python/cumin/grid-hadoop/main.py 2012-12-10 20:53:37 UTC (rev
5573)
+++ branches/elephant/cumin/python/cumin/gridhadoop/main.py 2012-12-10 21:57:46 UTC (rev
5574)
@@ -14,12 +14,15 @@
def __init__(self, app, name):
super(Module, self).__init__(app, name)
- self.frame = GridHadoopFrame(app, "gridhadoop")
- self.app = app
- self.frame.cumin_module = name
+ #self.nameNode_create = NameNodeCreate(app)
def init(self):
- self.app.main_page.main.inventory = self.frame
+ super(Module, self).init()
+
+ self.frame = GridHadoopFrame(self.app, "gridhadoop")
+ self.frame.cumin_module = self.name
+
+ self.app.main_page.main.gridhadoop = self.frame
self.app.main_page.main.add_tab(self.frame)
class GridHadoopFrame(CuminFrame):
@@ -39,7 +42,7 @@
# heading = self.Heading(app, "heading")
# self.add_child(heading)
- self.tabs = TabbedModeSet(app, "tabs")
+ self.tabs = TabbedModeSet(app, "childtabs")
self.add_child(self.tabs)
self.tabs.add_tab(NameNodeSelector(app, "namenodes"))