* added import_site_module() to other import_site_*() methods in utils
* made site_rpc_interface.py optional using import_site_module()
* made import_site_*() methods fail with an exception when a site file exists but isn't readable
Signed-off-by: Steve Howard <showard@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@3679 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/afe/views.py b/frontend/afe/views.py
index 499905d..32beb7a 100644
--- a/frontend/afe/views.py
+++ b/frontend/afe/views.py
@@ -1,10 +1,15 @@
import urllib2, sys, traceback, cgi
-from autotest_lib.frontend.afe import models, rpc_handler, rpc_interface
-from autotest_lib.frontend.afe import site_rpc_interface, rpc_utils
from django.http import HttpResponse, HttpResponsePermanentRedirect
from django.http import HttpResponseServerError
from django.template import Context, loader
+from autotest_lib.client.common_lib import utils
+from autotest_lib.frontend.afe import models, rpc_handler, rpc_interface
+from autotest_lib.frontend.afe import rpc_utils
+
+site_rpc_interface = utils.import_site_module(
+ __file__, 'autotest_lib.frontend.afe.site_rpc_interface',
+ dummy=object())
# since site_rpc_interface is later in the list, its methods will override those
# of rpc_interface