Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3080)

Unified Diff: appengine_module/gae_event_mon/__init__.py

Issue 2213143002: Add infra_libs as a bootstrap dependency. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine_module/gae_event_mon/__init__.py
diff --git a/appengine_module/gae_event_mon/__init__.py b/appengine_module/gae_event_mon/__init__.py
index 6f3b959b97ac46d608d54f31c18cb4c875011ba5..ca72adf1734d99c192ee3b69cb88ecfb96805ec8 100644
--- a/appengine_module/gae_event_mon/__init__.py
+++ b/appengine_module/gae_event_mon/__init__.py
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import imp
import logging
import os
import sys
@@ -19,6 +20,21 @@ sys.modules['infra_libs'].InstrumentedHttp = (
sys.modules['infra_libs'].event_mon = sys.modules[__package__]
sys.modules['infra_libs.event_mon'] = sys.modules[__package__]
+# Import time_functions explicitly, since gae_ts_mon messes with infra_libs.
+# TODO(sergeyberezin): clean up this mess. Do not meddle with magic.
Sergey Berezin 2016/08/04 20:21:25 FYI: this is the ugliest thing I had to do for thi
+try:
+ tf_file, tf_path, tf_desc = imp.find_module(
+ 'time_functions',
+ [os.path.dirname(__file__)])
+ tf_module = imp.load_module(
+ 'infra_libs.time_functions', tf_file, tf_path, tf_desc)
+finally:
+ if tf_file:
+ tf_file.close()
+
+sys.modules['infra_libs'].time_functions = tf_module
+sys.modules['infra_libs.time_functions'] = tf_module
+
from google.appengine.api import modules
from google.appengine.api.app_identity import app_identity

Powered by Google App Engine
This is Rietveld 408576698