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

Unified Diff: chrome/common/extensions/docs/server2/appengine_wrappers.py

Issue 23081003: Docserver move cron jobs to a backend instance Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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: chrome/common/extensions/docs/server2/appengine_wrappers.py
diff --git a/chrome/common/extensions/docs/server2/appengine_wrappers.py b/chrome/common/extensions/docs/server2/appengine_wrappers.py
index 86a43e4940fc6268f32b6b3ffd8f8d476a45eb29..87acdddc245e63cac1d89057327b91b049aa99e4 100644
--- a/chrome/common/extensions/docs/server2/appengine_wrappers.py
+++ b/chrome/common/extensions/docs/server2/appengine_wrappers.py
@@ -3,13 +3,17 @@
# found in the LICENSE file.
import os
+import re
from app_yaml_helper import AppYamlHelper
def GetAppVersion():
if 'CURRENT_VERSION_ID' in os.environ:
- # The version ID looks like 2-0-25.36712548, we only want the 2-0-25.
- return os.environ['CURRENT_VERSION_ID'].split('.', 1)[0]
+ # The version ID looks like 2-0-25.36712548 or on the backend
+ # backend_name:2-0-25.23982345. We only want the 2-0-25.
方觉(Fang Jue) 2013/08/14 01:47:42 Backend's version ID will look like <backend-name>
+ return re.match(
+ r'(?:[_\w-]+:)?(\d+-\d+-\d+)\.\d+$',
+ os.environ['CURRENT_VERSION_ID']).group(1)
# Not running on appengine, get it from the app.yaml file ourselves.
app_yaml_path = os.path.join(os.path.split(__file__)[0], 'app.yaml')
with open(app_yaml_path, 'r') as app_yaml:

Powered by Google App Engine
This is Rietveld 408576698