r5775 - trunk/cumin/python/cumin/gridhadoop
by croberts@fedoraproject.org
Author: croberts
Date: 2013-06-24 20:18:39 +0000 (Mon, 24 Jun 2013)
New Revision: 5775
Modified:
trunk/cumin/python/cumin/gridhadoop/hadoop.py
Log:
Mapping "Unmanaged" to "Infrastructure" on the Details pages of hadoop objects.
Modified: trunk/cumin/python/cumin/gridhadoop/hadoop.py
===================================================================
--- trunk/cumin/python/cumin/gridhadoop/hadoop.py 2013-06-24 20:09:00 UTC (rev 5774)
+++ trunk/cumin/python/cumin/gridhadoop/hadoop.py 2013-06-24 20:18:39 UTC (rev 5775)
@@ -291,6 +291,8 @@
setattr(self, prop.name, aviary_response[1][0]["ref"][prop.name.lower()])
elif prop.name.lower() in ["parent_id", "parent_ipc"]:
setattr(self, prop.name, aviary_response[1][0]["parent"][prop.name.lower().split("_")[1]])
+ elif prop.name.lower() in ["state"] and aviary_response[1][0][prop.name.lower()].lower() == "unmanaged":
+ setattr(self, prop.name, "Infrastructure")
else:
setattr(self, prop.name, aviary_response[1][0][prop.name.lower()])
except AttributeError, e:
10 years, 10 months
r5774 - in trunk: cumin/python/cumin/gridhadoop sage/python/sage/aviary
by croberts@fedoraproject.org
Author: croberts
Date: 2013-06-24 20:09:00 +0000 (Mon, 24 Jun 2013)
New Revision: 5774
Modified:
trunk/cumin/python/cumin/gridhadoop/jobtracker.py
trunk/sage/python/sage/aviary/aviaryoperations.py
Log:
Fix so that adding an external job tracker will now pass along the owner field.
Modified: trunk/cumin/python/cumin/gridhadoop/jobtracker.py
===================================================================
--- trunk/cumin/python/cumin/gridhadoop/jobtracker.py 2013-06-24 13:19:26 UTC (rev 5773)
+++ trunk/cumin/python/cumin/gridhadoop/jobtracker.py 2013-06-24 20:09:00 UTC (rev 5774)
@@ -103,8 +103,9 @@
def do_invoke(self, session, object, invoc, args):
self.invoc = invoc
(ipc, http) = args
+ owner = session.client_session.username()
host = self.app.remote.get_hosts("SCHEDULER", "HADOOP")[0]
- self.app.remote.add_external_job_tracker(host, ipc, http, invoc.make_callback())
+ self.app.remote.add_external_job_tracker(host, ipc, http, owner, invoc.make_callback())
def get_title(self, session, x):
return "Add an infrastructure job tracker"
Modified: trunk/sage/python/sage/aviary/aviaryoperations.py
===================================================================
--- trunk/sage/python/sage/aviary/aviaryoperations.py 2013-06-24 13:19:26 UTC (rev 5773)
+++ trunk/sage/python/sage/aviary/aviaryoperations.py 2013-06-24 20:09:00 UTC (rev 5774)
@@ -1156,7 +1156,7 @@
client, "startNameNode", None, owner, None, ref)
t.start()
- def add_external_job_tracker(self, host, ipc, url, callback):
+ def add_external_job_tracker(self, host, ipc, url, owner, callback):
# This is special because the HadoooID is special, and
# also because the id refers to the jt itself as an external
# and not a namenode
@@ -1189,7 +1189,7 @@
ref.http = url
t = CallThread(self.call_client_retry, my_callback,
- client, "startJobTracker", ref)
+ client, "startJobTracker", ref, None, owner, None)
t.start()
def _make_id(self, client, val):
10 years, 10 months
r5773 - trunk/cumin/python/cumin/gridhadoop
by croberts@fedoraproject.org
Author: croberts
Date: 2013-06-24 13:19:26 +0000 (Mon, 24 Jun 2013)
New Revision: 5773
Modified:
trunk/cumin/python/cumin/gridhadoop/hadoop.py
Log:
Addressing some issues with how our HadoopObjects are built and how they are displayed when not all values are present.
Modified: trunk/cumin/python/cumin/gridhadoop/hadoop.py
===================================================================
--- trunk/cumin/python/cumin/gridhadoop/hadoop.py 2013-06-24 13:17:23 UTC (rev 5772)
+++ trunk/cumin/python/cumin/gridhadoop/hadoop.py 2013-06-24 13:19:26 UTC (rev 5773)
@@ -2,7 +2,7 @@
from cumin.objectselector import ObjectSelector, ObjectLinkColumn, ObjectTable, \
ObjectTableColumn, ObjectQmfTable, ObjectQmfSelectorTable, ObjectSelectorTaskForm, ObjectSelectorTask
-from cumin.objectframe import ObjectFrame, ObjectTaskForm, ObjectDetails
+from cumin.objectframe import ObjectFrame, ObjectTaskForm, ObjectDetails, DetailsAttributes
from cumin.util import *
from cumin.qmfadapter import ObjectQmfAdapter
from cumin.task import Task, TaskLink
@@ -62,10 +62,10 @@
val = record.ref.http
elif (column.name == "Ipc"):
val = record.ref.ipc
- elif (column.name == "Id"):
+ elif (column.name in ["Id", "_id"]):
val = record.ref.id
else:
- val = ""
+ val = None
field_data.append(val)
return field_data
@@ -302,11 +302,19 @@
name = self.__class__.__name__
args = (name, self._class, self._id, self._save_time)
return "%s(%s,%s,%s)" % args
+
+ def get_value(self, attr):
+ try:
+ value = getattr(self, attr)
+ except AttributeError:
+ value = ""
+ return value
+
class HadoopObjectDetails(ObjectDetails):
def __init__(self, app, name, object):
super(HadoopObjectDetails, self).__init__(app, name, object)
-
+
class HadoopNodeDeleteTask(ObjectSelectorTask):
def enter(self, session):
form_session = super(HadoopNodeDeleteTask, self).enter(session)
10 years, 10 months
r5772 - trunk/cumin/python/cumin
by croberts@fedoraproject.org
Author: croberts
Date: 2013-06-24 13:17:23 +0000 (Mon, 24 Jun 2013)
New Revision: 5772
Modified:
trunk/cumin/python/cumin/objectframe.py
Log:
In the event of an attribute value not being able to be formatted properly, we just return the raw value now.
Modified: trunk/cumin/python/cumin/objectframe.py
===================================================================
--- trunk/cumin/python/cumin/objectframe.py 2013-06-23 13:31:28 UTC (rev 5771)
+++ trunk/cumin/python/cumin/objectframe.py 2013-06-24 13:17:23 UTC (rev 5772)
@@ -131,13 +131,20 @@
obj = self.object.get(session)
for attr in self.get_attributes(session):
- # name and title are from rosemary xml files
- name = attr.title
- # We are going to escape the value in ObjectAttributesEntry below
- value = obj.get_formatted_value(attr.name, escape=False)
- title = attr.description
+ try:
+ # name and title are from rosemary xml files
+ name = attr.title
+ # We are going to escape the value in ObjectAttributesEntry below
+ value = obj.get_formatted_value(attr.name, escape=False)
+ title = attr.description
- writer.write(self.entry.render(session, name, value, title))
+ writer.write(self.entry.render(session, name, value, title))
+ except:
+ name = attr.title
+ value = obj.get_value(attr.name)
+ title = attr.description
+
+ writer.write(self.entry.render(session, name, value, title))
return writer.to_string()
10 years, 10 months
r5771 - in trunk: cumin/python/cumin/gridhadoop sage/python/sage/aviary
by croberts@fedoraproject.org
Author: croberts
Date: 2013-06-23 13:31:28 +0000 (Sun, 23 Jun 2013)
New Revision: 5771
Modified:
trunk/cumin/python/cumin/gridhadoop/namenode.py
trunk/sage/python/sage/aviary/aviaryoperations.py
Log:
Now passing owner to add_external_name_node.
Modified: trunk/cumin/python/cumin/gridhadoop/namenode.py
===================================================================
--- trunk/cumin/python/cumin/gridhadoop/namenode.py 2013-06-23 13:30:30 UTC (rev 5770)
+++ trunk/cumin/python/cumin/gridhadoop/namenode.py 2013-06-23 13:31:28 UTC (rev 5771)
@@ -101,7 +101,8 @@
self.invoc = invoc
(ipc, http) = args
host = self.app.remote.get_hosts("SCHEDULER", "HADOOP")[0]
- self.app.remote.add_external_name_node(host, ipc, http, invoc.make_callback())
+ owner = session.client_session.username()
+ self.app.remote.add_external_name_node(host, ipc, http, owner, invoc.make_callback())
def get_title(self, session, x):
return "Add an infrastructure name node"
Modified: trunk/sage/python/sage/aviary/aviaryoperations.py
===================================================================
--- trunk/sage/python/sage/aviary/aviaryoperations.py 2013-06-23 13:30:30 UTC (rev 5770)
+++ trunk/sage/python/sage/aviary/aviaryoperations.py 2013-06-23 13:31:28 UTC (rev 5771)
@@ -1122,7 +1122,7 @@
def get_task_tracker_list(self, owner=None, callback=None):
return self._get_node_list(self.get_task_tracker, owner, callback)
- def add_external_name_node(self, host, ipc, url, callback):
+ def add_external_name_node(self, host, ipc, url, owner, callback):
# This is special because the HadoopID is special
assert callable(callback)
@@ -1153,7 +1153,7 @@
ref.http = url
t = CallThread(self.call_client_retry, my_callback,
- client, "startNameNode", None, None, None, ref)
+ client, "startNameNode", None, owner, None, ref)
t.start()
def add_external_job_tracker(self, host, ipc, url, callback):
10 years, 10 months
r5770 - trunk/cumin/python/cumin/gridhadoop
by croberts@fedoraproject.org
Author: croberts
Date: 2013-06-23 13:30:30 +0000 (Sun, 23 Jun 2013)
New Revision: 5770
Modified:
trunk/cumin/python/cumin/gridhadoop/hadoop.py
Log:
Translating "unmanaged" to "Infrastructure" for state.
Modified: trunk/cumin/python/cumin/gridhadoop/hadoop.py
===================================================================
--- trunk/cumin/python/cumin/gridhadoop/hadoop.py 2013-06-23 11:29:17 UTC (rev 5769)
+++ trunk/cumin/python/cumin/gridhadoop/hadoop.py 2013-06-23 13:30:30 UTC (rev 5770)
@@ -51,7 +51,10 @@
if column.name.lower() in ["parent_id", "parent_ipc"]:
val = record.parent[column.name.lower().split("_")[1]]
elif column.name == "State":
- val = record[column.name.lower()].title()
+ if record[column.name.lower()].title() == "Unmanaged":
+ val = "Infrastructure"
+ else:
+ val = record[column.name.lower()].title()
else:
val = record[column.name.lower()]
except AttributeError:
@@ -59,8 +62,10 @@
val = record.ref.http
elif (column.name == "Ipc"):
val = record.ref.ipc
+ elif (column.name == "Id"):
+ val = record.ref.id
else:
- val = record.ref.id
+ val = ""
field_data.append(val)
return field_data
10 years, 10 months
r5769 - trunk/cumin/python/cumin/gridhadoop
by croberts@fedoraproject.org
Author: croberts
Date: 2013-06-23 11:29:17 +0000 (Sun, 23 Jun 2013)
New Revision: 5769
Modified:
trunk/cumin/python/cumin/gridhadoop/hadoop.py
Log:
Now grabbing the http value from its new location in HadoopId
Modified: trunk/cumin/python/cumin/gridhadoop/hadoop.py
===================================================================
--- trunk/cumin/python/cumin/gridhadoop/hadoop.py 2013-06-22 12:00:14 UTC (rev 5768)
+++ trunk/cumin/python/cumin/gridhadoop/hadoop.py 2013-06-23 11:29:17 UTC (rev 5769)
@@ -55,7 +55,9 @@
else:
val = record[column.name.lower()]
except AttributeError:
- if (column.name == "Ipc"):
+ if (column.name == "Http"):
+ val = record.ref.http
+ elif (column.name == "Ipc"):
val = record.ref.ipc
else:
val = record.ref.id
10 years, 10 months
r5768 - trunk/cumin/model/access
by croberts@fedoraproject.org
Author: croberts
Date: 2013-06-22 12:00:14 +0000 (Sat, 22 Jun 2013)
New Revision: 5768
Modified:
trunk/cumin/model/access/persona.xml
Log:
Removing the inventory tab from the hadoop persona.
Modified: trunk/cumin/model/access/persona.xml
===================================================================
--- trunk/cumin/model/access/persona.xml 2013-06-21 21:51:38 UTC (rev 5767)
+++ trunk/cumin/model/access/persona.xml 2013-06-22 12:00:14 UTC (rev 5768)
@@ -55,7 +55,6 @@
<Persona name="hadoop" auth="True">
<Module name="account"/>
<Module name="configuration"/>
- <Module name="inventory"/>
<Module name="gridhadoop"/>
<Module name="user"/>
<Module name="user.hadoop"/>
10 years, 10 months
r5767 - trunk/cumin/python/cumin/gridhadoop
by croberts@fedoraproject.org
Author: croberts
Date: 2013-06-21 21:51:38 +0000 (Fri, 21 Jun 2013)
New Revision: 5767
Modified:
trunk/cumin/python/cumin/gridhadoop/jobtracker.py
Log:
Handling potential empty ipc value for job trackers.
Modified: trunk/cumin/python/cumin/gridhadoop/jobtracker.py
===================================================================
--- trunk/cumin/python/cumin/gridhadoop/jobtracker.py 2013-06-21 21:36:26 UTC (rev 5766)
+++ trunk/cumin/python/cumin/gridhadoop/jobtracker.py 2013-06-21 21:51:38 UTC (rev 5767)
@@ -79,7 +79,9 @@
class JobTrackerColumn(ObjectLinkColumn):
def render_cell_href(self, session, record):
id = unescape_entity(record[self.id_field.index])
- ipc = unescape_entity(record[self.parent.ipc_col.field.index])
+ ipc = None
+ if record[self.parent.ipc_col.field.index]:
+ ipc = unescape_entity(record[self.parent.ipc_col.field.index])
frame = self.frame.children_by_name[self.frame.name + self.frame_path]
return frame.get_href(session, id, self.app.remote.get_hosts("SCHEDULER", "HADOOP")[0], ipc)
10 years, 10 months
r5766 - trunk/cumin/python/cumin/gridhadoop
by croberts@fedoraproject.org
Author: croberts
Date: 2013-06-21 21:36:26 +0000 (Fri, 21 Jun 2013)
New Revision: 5766
Modified:
trunk/cumin/python/cumin/gridhadoop/hadoop.py
Log:
Making cumin a little more robust when we get nothing back for an http value (this can happen when the node is still starting up, or when things are really hosed).
Modified: trunk/cumin/python/cumin/gridhadoop/hadoop.py
===================================================================
--- trunk/cumin/python/cumin/gridhadoop/hadoop.py 2013-06-21 14:35:16 UTC (rev 5765)
+++ trunk/cumin/python/cumin/gridhadoop/hadoop.py 2013-06-21 21:36:26 UTC (rev 5766)
@@ -340,8 +340,18 @@
class HadoopHttpColumn(HadoopObjectLinkColumn):
def render_cell_href(self, session, record):
- link = self.field.get_content(session, record)
+ if "://" not in self.field.get_content(session, record):
+ link = ""
+ else:
+ link = self.field.get_content(session, record)
return link
+
+ def render_cell_content(self, session, record):
+ if "://" not in self.field.get_content(session, record):
+ value = ""
+ else:
+ value = self.field.get_content(session, record)
+ return value
class HadoopExternalAddForm(HadoopNodeCreateForm):
def __init__(self, app, name, task, cls):
10 years, 10 months