Fix error when accessing some pages of the admin interface

Signed-off-by: James Ren <[email protected]>

--- autotest/frontend/afe/rpc_handler.py        2010-01-15 13:53:41.000000000 
-0800
+++ autotest/frontend/afe/rpc_handler.py        2010-01-15 13:53:41.000000000 
-0800
@@ -5,7 +5,7 @@
 
 __author__ = '[email protected] (Steve Howard)'
 
-import traceback, pydoc, re, urllib, logging, logging.handlers
+import traceback, pydoc, re, urllib, logging, logging.handlers, inspect
 from autotest_lib.frontend.afe.json_rpc import serviceHandler
 from autotest_lib.frontend.afe import models, rpc_utils
 from autotest_lib.client.common_lib import global_config
@@ -127,7 +127,7 @@
             if name.startswith('_'):
                 continue
             attribute = getattr(module, name)
-            if not callable(attribute):
+            if not inspect.isfunction(attribute):
                 continue
             decorated_function = RpcHandler._allow_keyword_args(attribute)
             setattr(self._rpc_methods, name, decorated_function)
--- autotest/frontend/afe/urls.py       2010-01-15 13:53:41.000000000 -0800
+++ autotest/frontend/afe/urls.py       2010-01-15 13:53:41.000000000 -0800
@@ -13,6 +13,7 @@
 # Job feeds
 debug_patterns += defaults.patterns(
         '',
+        (r'^model_doc/', 'frontend.afe.views.model_documentation'),
         (r'^feeds/(?P<url>.*)/$', 'frontend.afe.feeds.feed.feed_view',
          {'feed_dict': feeds})
     )
--- autotest/frontend/planner/views.py  2010-01-15 13:53:41.000000000 -0800
+++ autotest/frontend/planner/views.py  2010-01-15 13:53:41.000000000 -0800
@@ -15,10 +15,3 @@
 
 def rpc_documentation(request):
     return rpc_handler_obj.get_rpc_documentation()
-
-
-def model_documentation(request):
-    model_names = ('Plan', 'Host', 'ControlFile', 'Test', 'Job', 'KeyVal',
-                   'Bug', 'TestRun', 'DataType', 'History', 'SavedObject',
-                   'CustomQuery', 'AutoProcess')
-    return views_common.model_documentation(models, model_names)
--- autotest/frontend/urls_common.py    2010-01-15 13:53:41.000000000 -0800
+++ autotest/frontend/urls_common.py    2010-01-15 13:53:41.000000000 -0800
@@ -19,8 +19,6 @@
         )
 
     debug_pattern_list = defaults.patterns('',
-            (r'^model_doc/', '%s.views.model_documentation' % django_name),
-
             # for GWT hosted mode
             (r'^(?P<forward_addr>autotest.*)',
              'autotest_lib.frontend.afe.views.gwt_forward'),
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to