blob: e75f31e67c739eb8eb79775795601bbe9adfecdf [file] [log] [blame]
Chris Sosa7c931362010-10-11 19:49:01 -07001#!/usr/bin/python
2
Chris Sosa0356d3b2010-09-16 15:46:22 -07003# Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved.
rtc@google.comded22402009-10-26 22:36:21 +00004# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
Chris Sosa7c931362010-10-11 19:49:01 -07007"""A CherryPy-based webserver to host images and build packages."""
8
9import cherrypy
Sean O'Connor14b6a0a2010-03-20 23:23:48 -070010import optparse
rtc@google.comded22402009-10-26 22:36:21 +000011import os
Scott Zawalski4647ce62012-01-03 17:17:28 -050012import re
chocobo@google.com4dc25812009-10-27 23:46:26 +000013import sys
rtc@google.comded22402009-10-26 22:36:21 +000014
Chris Sosa0356d3b2010-09-16 15:46:22 -070015import autoupdate
Chris Sosa0356d3b2010-09-16 15:46:22 -070016
Frank Farzan40160872011-12-12 18:39:18 -080017
Chris Sosa417e55d2011-01-25 16:40:48 -080018CACHED_ENTRIES = 12
Don Garrettf90edf02010-11-16 17:36:14 -080019
Chris Sosa0356d3b2010-09-16 15:46:22 -070020# Sets up global to share between classes.
rtc@google.com21a5ca32009-11-04 18:23:23 +000021global updater
22updater = None
rtc@google.comded22402009-10-26 22:36:21 +000023
Frank Farzan40160872011-12-12 18:39:18 -080024
Scott Zawalski4647ce62012-01-03 17:17:28 -050025def _LeadingWhiteSpaceCount(string):
26 """Count the amount of leading whitespace in a string.
27
28 Args:
29 string: The string to count leading whitespace in.
30 Returns:
31 number of white space chars before characters start.
32 """
33 matched = re.match('^\s+', string)
34 if matched:
35 return len(matched.group())
36
37 return 0
38
39
40def _PrintDocStringAsHTML(func):
41 """Make a functions docstring somewhat HTML style.
42
43 Args:
44 func: The function to return the docstring from.
45 Returns:
46 A string that is somewhat formated for a web browser.
47 """
48 # TODO(scottz): Make this parse Args/Returns in a prettier way.
49 # Arguments could be bolded and indented etc.
50 html_doc = []
51 for line in func.__doc__.splitlines():
52 leading_space = _LeadingWhiteSpaceCount(line)
53 if leading_space > 0:
54 line = ' '*leading_space + line
55
56 html_doc.append('<BR>%s' % line)
57
58 return '\n'.join(html_doc)
59
60
Chris Sosa7c931362010-10-11 19:49:01 -070061def _GetConfig(options):
62 """Returns the configuration for the devserver."""
Scott Zawalski8b64bc92012-02-23 20:08:40 -050063 base_path = os.path.dirname(__file__)
64 access_log = os.path.join(base_path, 'devserver_access.log')
65 error_log = os.path.join(base_path, 'devserver_error.log')
Chris Sosa7c931362010-10-11 19:49:01 -070066 base_config = { 'global':
67 { 'server.log_request_headers': True,
68 'server.protocol_version': 'HTTP/1.1',
Aaron Plattner2bfab982011-05-20 09:01:08 -070069 'server.socket_host': '::',
Chris Sosa7c931362010-10-11 19:49:01 -070070 'server.socket_port': int(options.port),
Chris Sosa374c62d2010-10-14 09:13:54 -070071 'server.socket_timeout': 6000,
72 'response.timeout': 6000,
Zdenek Behan1347a312011-02-10 03:59:17 +010073 'tools.staticdir.root':
74 os.path.dirname(os.path.abspath(sys.argv[0])),
Scott Zawalski8b64bc92012-02-23 20:08:40 -050075 'log.access_file': access_log,
76 'log.error_file': error_log,
Chris Sosa7c931362010-10-11 19:49:01 -070077 },
Dale Curtisc9aaf3a2011-08-09 15:47:40 -070078 '/api':
79 {
80 # Gets rid of cherrypy parsing post file for args.
81 'request.process_request_body': False,
82 },
Chris Sosaa1ef0102010-10-21 16:22:35 -070083 '/build':
84 {
85 'response.timeout': 100000,
86 },
Chris Sosa7c931362010-10-11 19:49:01 -070087 '/update':
88 {
89 # Gets rid of cherrypy parsing post file for args.
90 'request.process_request_body': False,
Chris Sosaf65f4b92010-10-21 15:57:51 -070091 'response.timeout': 10000,
Chris Sosa7c931362010-10-11 19:49:01 -070092 },
93 # Sets up the static dir for file hosting.
94 '/static':
95 { 'tools.staticdir.dir': 'static',
96 'tools.staticdir.on': True,
Chris Sosaf65f4b92010-10-21 15:57:51 -070097 'response.timeout': 10000,
Chris Sosa7c931362010-10-11 19:49:01 -070098 },
99 }
Chris Sosa417e55d2011-01-25 16:40:48 -0800100 if options.production:
101 base_config['global']['server.environment'] = 'production'
102
Chris Sosa7c931362010-10-11 19:49:01 -0700103 return base_config
rtc@google.com64244662009-11-12 00:52:08 +0000104
Darin Petkove17164a2010-08-11 13:24:41 -0700105
Zdenek Behan608f46c2011-02-19 00:47:16 +0100106def _PrepareToServeUpdatesOnly(image_dir, static_dir):
Chris Sosa0356d3b2010-09-16 15:46:22 -0700107 """Sets up symlink to image_dir for serving purposes."""
108 assert os.path.exists(image_dir), '%s must exist.' % image_dir
109 # If we're serving out of an archived build dir (e.g. a
110 # buildbot), prepare this webserver's magic 'static/' dir with a
111 # link to the build archive.
Chris Sosa7c931362010-10-11 19:49:01 -0700112 cherrypy.log('Preparing autoupdate for "serve updates only" mode.',
113 'DEVSERVER')
Zdenek Behan608f46c2011-02-19 00:47:16 +0100114 if os.path.lexists('%s/archive' % static_dir):
115 if image_dir != os.readlink('%s/archive' % static_dir):
Chris Sosa7c931362010-10-11 19:49:01 -0700116 cherrypy.log('removing stale symlink to %s' % image_dir, 'DEVSERVER')
Zdenek Behan608f46c2011-02-19 00:47:16 +0100117 os.unlink('%s/archive' % static_dir)
118 os.symlink(image_dir, '%s/archive' % static_dir)
Chris Sosa0356d3b2010-09-16 15:46:22 -0700119 else:
Zdenek Behan608f46c2011-02-19 00:47:16 +0100120 os.symlink(image_dir, '%s/archive' % static_dir)
Chris Sosa7c931362010-10-11 19:49:01 -0700121 cherrypy.log('archive dir: %s ready to be used to serve images.' % image_dir,
122 'DEVSERVER')
123
124
Dale Curtisc9aaf3a2011-08-09 15:47:40 -0700125class ApiRoot(object):
126 """RESTful API for Dev Server information."""
127 exposed = True
128
129 @cherrypy.expose
130 def hostinfo(self, ip):
131 """Returns a JSON dictionary containing information about the given ip.
132
133 Not all information may be known at the time the request is made. The
134 possible keys are:
135
136 last_event_type: int
137 Last update event type received.
138
139 last_event_status: int
140 Last update event status received.
141
142 last_known_version: string
143 Last known version recieved for update ping.
144
145 forced_update_label: string
146 Update label to force next update ping to use. Set by setnextupdate.
147
148 See the OmahaEvent class in update_engine/omaha_request_action.h for status
149 code definitions. If the ip does not exist an empty string is returned."""
150 return updater.HandleHostInfoPing(ip)
151
152 @cherrypy.expose
Gilad Arnold286a0062012-01-12 13:47:02 -0800153 def hostlog(self, ip):
154 """Returns a JSON object containing a log of events pertaining to a
155 particular host, or all hosts. Log events contain a timestamp and any
156 subset of the attributes listed for the hostinfo method."""
157 return updater.HandleHostLogPing(ip)
158
159 @cherrypy.expose
Dale Curtisc9aaf3a2011-08-09 15:47:40 -0700160 def setnextupdate(self, ip):
161 """Allows the response to the next update ping from a host to be set.
162
163 Takes the IP of the host and an update label as normally provided to the
164 /update command."""
165 body_length = int(cherrypy.request.headers['Content-Length'])
166 label = cherrypy.request.rfile.read(body_length)
167
168 if label:
169 label = label.strip()
170 if label:
171 return updater.HandleSetUpdatePing(ip, label)
172 raise cherrypy.HTTPError(400, 'No label provided.')
173
174
David Rochberg7c79a812011-01-19 14:24:45 -0500175class DevServerRoot(object):
Chris Sosa7c931362010-10-11 19:49:01 -0700176 """The Root Class for the Dev Server.
177
178 CherryPy works as follows:
179 For each method in this class, cherrpy interprets root/path
180 as a call to an instance of DevServerRoot->method_name. For example,
181 a call to http://myhost/build will call build. CherryPy automatically
182 parses http args and places them as keyword arguments in each method.
183 For paths http://myhost/update/dir1/dir2, you can use *args so that
184 cherrypy uses the update method and puts the extra paths in args.
185 """
Dale Curtisc9aaf3a2011-08-09 15:47:40 -0700186 api = ApiRoot()
Chris Sosa7c931362010-10-11 19:49:01 -0700187
David Rochberg7c79a812011-01-19 14:24:45 -0500188 def __init__(self):
Nick Sanders7dcaa2e2011-08-04 15:20:41 -0700189 self._builder = None
Frank Farzan40160872011-12-12 18:39:18 -0800190 self._downloader = None
David Rochberg7c79a812011-01-19 14:24:45 -0500191
Dale Curtisc9aaf3a2011-08-09 15:47:40 -0700192 @cherrypy.expose
David Rochberg7c79a812011-01-19 14:24:45 -0500193 def build(self, board, pkg, **kwargs):
Chris Sosa7c931362010-10-11 19:49:01 -0700194 """Builds the package specified."""
Nick Sanders7dcaa2e2011-08-04 15:20:41 -0700195 import builder
196 if self._builder is None:
197 self._builder = builder.Builder()
David Rochberg7c79a812011-01-19 14:24:45 -0500198 return self._builder.Build(board, pkg, kwargs)
Chris Sosa7c931362010-10-11 19:49:01 -0700199
Dale Curtisc9aaf3a2011-08-09 15:47:40 -0700200 @cherrypy.expose
Frank Farzanbcb571e2012-01-03 11:48:17 -0800201 def download(self, **kwargs):
202 """Downloads and archives full/delta payloads from Google Storage.
203
204 Args:
205 archive_url: Google Storage URL for the build.
206
207 Example URL:
208 'http://myhost/download?archive_url=gs://chromeos-image-archive/'
209 'x86-generic/R17-1208.0.0-a1-b338'
210 """
Frank Farzan40160872011-12-12 18:39:18 -0800211 import downloader
Frank Farzan40160872011-12-12 18:39:18 -0800212 if self._downloader is None:
213 self._downloader = downloader.Downloader(updater.static_dir)
Frank Farzanbcb571e2012-01-03 11:48:17 -0800214 return self._downloader.Download(kwargs['archive_url'])
Frank Farzan40160872011-12-12 18:39:18 -0800215
216 @cherrypy.expose
Scott Zawalski84a39c92012-01-13 15:12:42 -0500217 def controlfiles(self, **params):
Scott Zawalski4647ce62012-01-03 17:17:28 -0500218 """Return a control file or a list of all known control files.
219
220 Example URL:
221 To List all control files:
Scott Zawalski84a39c92012-01-13 15:12:42 -0500222 http://dev-server/controlfiles?board=x86-alex-release&build=R18-1514.0.0
Scott Zawalski4647ce62012-01-03 17:17:28 -0500223 To return the contents of a path:
Scott Zawalski84a39c92012-01-13 15:12:42 -0500224 http://dev-server/controlfiles?board=x86-alex-release&build=R18-1514.0.0&control_path=client/sleeptest/control
Scott Zawalski4647ce62012-01-03 17:17:28 -0500225
226 Args:
Scott Zawalski84a39c92012-01-13 15:12:42 -0500227 build: The build i.e. x86-alex-release/R18-1514.0.0-a1-b1450.
Scott Zawalski4647ce62012-01-03 17:17:28 -0500228 control_path: If you want the contents of a control file set this
229 to the path. E.g. client/site_tests/sleeptest/control
230 Optional, if not provided return a list of control files is returned.
231 Returns:
232 Contents of a control file if control_path is provided.
233 A list of control files if no control_path is provided.
234 """
Frank Farzan40160872011-12-12 18:39:18 -0800235 import devserver_util
Scott Zawalski4647ce62012-01-03 17:17:28 -0500236 if not params:
237 return _PrintDocStringAsHTML(self.controlfiles)
238
Scott Zawalski84a39c92012-01-13 15:12:42 -0500239 if 'build' not in params:
240 errmsg = 'Error: build is required!'
Scott Zawalski4647ce62012-01-03 17:17:28 -0500241 raise cherrypy.HTTPError('500 Internal Server Error',
Scott Zawalski84a39c92012-01-13 15:12:42 -0500242 'Error: build= is required!')
Scott Zawalski4647ce62012-01-03 17:17:28 -0500243
244 if 'control_path' not in params:
245 return devserver_util.GetControlFileList(updater.static_dir,
Scott Zawalski84a39c92012-01-13 15:12:42 -0500246 params['build'])
Scott Zawalski4647ce62012-01-03 17:17:28 -0500247 else:
Scott Zawalski84a39c92012-01-13 15:12:42 -0500248 return devserver_util.GetControlFile(updater.static_dir, params['build'],
Scott Zawalski4647ce62012-01-03 17:17:28 -0500249 params['control_path'])
Frank Farzan40160872011-12-12 18:39:18 -0800250
251 @cherrypy.expose
Chris Sosa7c931362010-10-11 19:49:01 -0700252 def index(self):
253 return 'Welcome to the Dev Server!'
254
Dale Curtisc9aaf3a2011-08-09 15:47:40 -0700255 @cherrypy.expose
Chris Sosa7c931362010-10-11 19:49:01 -0700256 def update(self, *args):
257 label = '/'.join(args)
Gilad Arnold286a0062012-01-12 13:47:02 -0800258 body_length = int(cherrypy.request.headers.get('Content-Length', 0))
Chris Sosa7c931362010-10-11 19:49:01 -0700259 data = cherrypy.request.rfile.read(body_length)
260 return updater.HandleUpdatePing(data, label)
261
Chris Sosa0356d3b2010-09-16 15:46:22 -0700262
Sean O'Connor14b6a0a2010-03-20 23:23:48 -0700263if __name__ == '__main__':
264 usage = 'usage: %prog [options]'
Gilad Arnold286a0062012-01-12 13:47:02 -0800265 parser = optparse.OptionParser(usage=usage)
Sean O'Connore38ea152010-04-16 13:50:40 -0700266 parser.add_option('--archive_dir', dest='archive_dir',
Sean O'Connor14b6a0a2010-03-20 23:23:48 -0700267 help='serve archived builds only.')
Chris Sosae67b78f2010-11-04 17:33:16 -0700268 parser.add_option('--board', dest='board',
269 help='When pre-generating update, board for latest image.')
Don Garrett0c880e22010-11-17 18:13:37 -0800270 parser.add_option('--clear_cache', action='store_true', default=False,
Don Garrettf90edf02010-11-16 17:36:14 -0800271 help='Clear out all cached udpates and exit')
Greg Spencerc8b59b22011-03-15 14:15:23 -0700272 parser.add_option('--client_prefix', dest='client_prefix_deprecated',
273 help='No longer used. It is still here so we don\'t break '
274 'scripts that used it.', default='')
Satoru Takabayashid733cbe2011-11-15 09:36:32 -0800275 parser.add_option('--critical_update', dest='critical_update',
276 action='store_true', default=False,
277 help='Present update payload as critical')
Zdenek Behan5d21a2a2011-02-12 02:06:01 +0100278 parser.add_option('--data_dir', dest='data_dir',
279 help='Writable directory where static lives',
280 default=os.path.dirname(os.path.abspath(sys.argv[0])))
Don Garrett0c880e22010-11-17 18:13:37 -0800281 parser.add_option('--exit', action='store_true', default=False,
282 help='Don\'t start the server (still pregenerate or clear'
283 'cache).')
Andrew de los Reyes52620802010-04-12 13:40:07 -0700284 parser.add_option('--factory_config', dest='factory_config',
285 help='Config file for serving images from factory floor.')
Chris Sosa4136e692010-10-28 23:42:37 -0700286 parser.add_option('--for_vm', dest='vm', default=False, action='store_true',
287 help='Update is for a vm image.')
Chris Sosa0356d3b2010-09-16 15:46:22 -0700288 parser.add_option('--image', dest='image',
289 help='Force update using this image.')
Chris Sosa2c048f12010-10-27 16:05:27 -0700290 parser.add_option('-p', '--pregenerate_update', action='store_true',
291 default=False, help='Pre-generate update payload.')
Don Garrett0c880e22010-11-17 18:13:37 -0800292 parser.add_option('--payload', dest='payload',
293 help='Use update payload from specified directory.')
Chris Sosa7c931362010-10-11 19:49:01 -0700294 parser.add_option('--port', default=8080,
Gilad Arnold286a0062012-01-12 13:47:02 -0800295 help='Port for the dev server to use (default: 8080).')
Chris Sosa0f1ec842011-02-14 16:33:22 -0800296 parser.add_option('--private_key', default=None,
297 help='Path to the private key in pem format.')
Chris Sosa417e55d2011-01-25 16:40:48 -0800298 parser.add_option('--production', action='store_true', default=False,
299 help='Have the devserver use production values.')
Don Garrett0ad09372010-12-06 16:20:30 -0800300 parser.add_option('--proxy_port', default=None,
301 help='Port to have the client connect to (testing support)')
Chris Sosa62f720b2010-10-26 21:39:48 -0700302 parser.add_option('--src_image', default='',
303 help='Image on remote machine for generating delta update.')
Sean O'Connor1f7fd362010-04-07 16:34:52 -0700304 parser.add_option('-t', action='store_true', dest='test_image')
305 parser.add_option('-u', '--urlbase', dest='urlbase',
306 help='base URL, other than devserver, for update images.')
Andrew de los Reyes52620802010-04-12 13:40:07 -0700307 parser.add_option('--validate_factory_config', action="store_true",
308 dest='validate_factory_config',
309 help='Validate factory config file, then exit.')
Gilad Arnold286a0062012-01-12 13:47:02 -0800310 parser.add_option('-l', '--logging', action="store_true", default=False,
311 help='Enable logging and reporting of update processes.')
Chris Sosa7c931362010-10-11 19:49:01 -0700312 (options, _) = parser.parse_args()
rtc@google.com21a5ca32009-11-04 18:23:23 +0000313
Chris Sosa7c931362010-10-11 19:49:01 -0700314 devserver_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
315 root_dir = os.path.realpath('%s/../..' % devserver_dir)
Chris Sosa0356d3b2010-09-16 15:46:22 -0700316 serve_only = False
317
Zdenek Behan608f46c2011-02-19 00:47:16 +0100318 static_dir = os.path.realpath('%s/static' % options.data_dir)
319 os.system('mkdir -p %s' % static_dir)
320
Sean O'Connor14b6a0a2010-03-20 23:23:48 -0700321 if options.archive_dir:
Zdenek Behan608f46c2011-02-19 00:47:16 +0100322 # TODO(zbehan) Remove legacy support:
323 # archive_dir is the directory where static/archive will point.
324 # If this is an absolute path, all is fine. If someone calls this
325 # using a relative path, that is relative to src/platform/dev/.
326 # That use case is unmaintainable, but since applications use it
327 # with =./static, instead of a boolean flag, we'll make this relative
328 # to devserver_dir to keep these unbroken. For now.
329 archive_dir = options.archive_dir
330 if not os.path.isabs(archive_dir):
331 archive_dir = os.path.realpath(os.path.join(devserver_dir,archive_dir))
332 _PrepareToServeUpdatesOnly(archive_dir, static_dir)
Zdenek Behan6d93e552011-03-02 22:35:49 +0100333 static_dir = os.path.realpath(archive_dir)
Chris Sosa0356d3b2010-09-16 15:46:22 -0700334 serve_only = True
Chris Sosa0356d3b2010-09-16 15:46:22 -0700335
Don Garrettf90edf02010-11-16 17:36:14 -0800336 cache_dir = os.path.join(static_dir, 'cache')
337 cherrypy.log('Using cache directory %s' % cache_dir, 'DEVSERVER')
338
Don Garrettf90edf02010-11-16 17:36:14 -0800339 if os.path.exists(cache_dir):
Chris Sosa6b8c3742011-01-31 12:12:17 -0800340 if options.clear_cache:
341 # Clear the cache and exit on error.
342 if os.system('rm -rf %s/*' % cache_dir) != 0:
343 cherrypy.log('Failed to clear the cache with %s' % cmd,
344 'DEVSERVER')
345 sys.exit(1)
346
347 else:
348 # Clear all but the last N cached updates
349 cmd = ('cd %s; ls -tr | head --lines=-%d | xargs rm -rf' %
350 (cache_dir, CACHED_ENTRIES))
351 if os.system(cmd) != 0:
352 cherrypy.log('Failed to clean up old delta cache files with %s' % cmd,
353 'DEVSERVER')
354 sys.exit(1)
355 else:
356 os.makedirs(cache_dir)
Don Garrettf90edf02010-11-16 17:36:14 -0800357
Greg Spencerc8b59b22011-03-15 14:15:23 -0700358 if options.client_prefix_deprecated:
359 cherrypy.log('The --client_prefix argument is DEPRECATED, '
360 'and is no longer needed.', 'DEVSERVER')
361
Zdenek Behan5d21a2a2011-02-12 02:06:01 +0100362 cherrypy.log('Data dir is %s' % options.data_dir, 'DEVSERVER')
Chris Sosa7c931362010-10-11 19:49:01 -0700363 cherrypy.log('Source root is %s' % root_dir, 'DEVSERVER')
364 cherrypy.log('Serving from %s' % static_dir, 'DEVSERVER')
rtc@google.com21a5ca32009-11-04 18:23:23 +0000365
Andrew de los Reyes52620802010-04-12 13:40:07 -0700366 updater = autoupdate.Autoupdate(
367 root_dir=root_dir,
368 static_dir=static_dir,
Chris Sosa0356d3b2010-09-16 15:46:22 -0700369 serve_only=serve_only,
Andrew de los Reyes52620802010-04-12 13:40:07 -0700370 urlbase=options.urlbase,
371 test_image=options.test_image,
372 factory_config_path=options.factory_config,
Chris Sosa5d342a22010-09-28 16:54:41 -0700373 forced_image=options.image,
Don Garrett0c880e22010-11-17 18:13:37 -0800374 forced_payload=options.payload,
Chris Sosa62f720b2010-10-26 21:39:48 -0700375 port=options.port,
Don Garrett0ad09372010-12-06 16:20:30 -0800376 proxy_port=options.proxy_port,
Chris Sosa4136e692010-10-28 23:42:37 -0700377 src_image=options.src_image,
Chris Sosae67b78f2010-11-04 17:33:16 -0700378 vm=options.vm,
Chris Sosa08d55a22011-01-19 16:08:02 -0800379 board=options.board,
Chris Sosa0f1ec842011-02-14 16:33:22 -0800380 copy_to_static_root=not options.exit,
381 private_key=options.private_key,
Satoru Takabayashid733cbe2011-11-15 09:36:32 -0800382 critical_update=options.critical_update,
Chris Sosa0f1ec842011-02-14 16:33:22 -0800383 )
Chris Sosa7c931362010-10-11 19:49:01 -0700384
385 # Sanity-check for use of validate_factory_config.
386 if not options.factory_config and options.validate_factory_config:
387 parser.error('You need a factory_config to validate.')
rtc@google.com64244662009-11-12 00:52:08 +0000388
Chris Sosa0356d3b2010-09-16 15:46:22 -0700389 if options.factory_config:
Chris Sosa7c931362010-10-11 19:49:01 -0700390 updater.ImportFactoryConfigFile(options.factory_config,
Chris Sosa0356d3b2010-09-16 15:46:22 -0700391 options.validate_factory_config)
Chris Sosa7c931362010-10-11 19:49:01 -0700392 # We don't run the dev server with this option.
393 if options.validate_factory_config:
394 sys.exit(0)
Chris Sosa2c048f12010-10-27 16:05:27 -0700395 elif options.pregenerate_update:
Chris Sosae67b78f2010-11-04 17:33:16 -0700396 if not updater.PreGenerateUpdate():
397 sys.exit(1)
Chris Sosa0356d3b2010-09-16 15:46:22 -0700398
Don Garrett0c880e22010-11-17 18:13:37 -0800399 # If the command line requested after setup, it's time to do it.
400 if not options.exit:
401 cherrypy.quickstart(DevServerRoot(), config=_GetConfig(options))