Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | |
Chris Sosa | 0356d3b | 2010-09-16 22:46:22 | [diff] [blame] | 3 | # Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved. |
[email protected] | ded2240 | 2009-10-26 22:36:21 | [diff] [blame] | 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 7 | """A CherryPy-based webserver to host images and build packages.""" |
| 8 | |
| 9 | import cherrypy |
Sean O'Connor | 14b6a0a | 2010-03-21 06:23:48 | [diff] [blame] | 10 | import optparse |
[email protected] | ded2240 | 2009-10-26 22:36:21 | [diff] [blame] | 11 | import os |
David Rochberg | 7c79a81 | 2011-01-19 19:24:45 | [diff] [blame] | 12 | import subprocess |
[email protected] | 4dc2581 | 2009-10-27 23:46:26 | [diff] [blame] | 13 | import sys |
[email protected] | ded2240 | 2009-10-26 22:36:21 | [diff] [blame] | 14 | |
Chris Sosa | 0356d3b | 2010-09-16 22:46:22 | [diff] [blame] | 15 | import autoupdate |
Chris Sosa | 0356d3b | 2010-09-16 22:46:22 | [diff] [blame] | 16 | |
Chris Sosa | 417e55d | 2011-01-26 00:40:48 | [diff] [blame] | 17 | CACHED_ENTRIES = 12 |
Don Garrett | f90edf0 | 2010-11-17 01:36:14 | [diff] [blame] | 18 | |
Chris Sosa | 0356d3b | 2010-09-16 22:46:22 | [diff] [blame] | 19 | # Sets up global to share between classes. |
[email protected] | 21a5ca3 | 2009-11-04 18:23:23 | [diff] [blame] | 20 | global updater |
| 21 | updater = None |
[email protected] | ded2240 | 2009-10-26 22:36:21 | [diff] [blame] | 22 | |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 23 | def _GetConfig(options): |
| 24 | """Returns the configuration for the devserver.""" |
| 25 | base_config = { 'global': |
| 26 | { 'server.log_request_headers': True, |
| 27 | 'server.protocol_version': 'HTTP/1.1', |
Aaron Plattner | 2bfab98 | 2011-05-20 16:01:08 | [diff] [blame] | 28 | 'server.socket_host': '::', |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 29 | 'server.socket_port': int(options.port), |
Chris Sosa | 374c62d | 2010-10-14 16:13:54 | [diff] [blame] | 30 | 'server.socket_timeout': 6000, |
| 31 | 'response.timeout': 6000, |
Zdenek Behan | 1347a31 | 2011-02-10 02:59:17 | [diff] [blame] | 32 | 'tools.staticdir.root': |
| 33 | os.path.dirname(os.path.abspath(sys.argv[0])), |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 34 | }, |
Dale Curtis | c9aaf3a | 2011-08-09 22:47:40 | [diff] [blame^] | 35 | '/api': |
| 36 | { |
| 37 | # Gets rid of cherrypy parsing post file for args. |
| 38 | 'request.process_request_body': False, |
| 39 | }, |
Chris Sosa | a1ef010 | 2010-10-21 23:22:35 | [diff] [blame] | 40 | '/build': |
| 41 | { |
| 42 | 'response.timeout': 100000, |
| 43 | }, |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 44 | '/update': |
| 45 | { |
| 46 | # Gets rid of cherrypy parsing post file for args. |
| 47 | 'request.process_request_body': False, |
Chris Sosa | f65f4b9 | 2010-10-21 22:57:51 | [diff] [blame] | 48 | 'response.timeout': 10000, |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 49 | }, |
| 50 | # Sets up the static dir for file hosting. |
| 51 | '/static': |
| 52 | { 'tools.staticdir.dir': 'static', |
| 53 | 'tools.staticdir.on': True, |
Chris Sosa | f65f4b9 | 2010-10-21 22:57:51 | [diff] [blame] | 54 | 'response.timeout': 10000, |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 55 | }, |
| 56 | } |
Chris Sosa | 417e55d | 2011-01-26 00:40:48 | [diff] [blame] | 57 | if options.production: |
| 58 | base_config['global']['server.environment'] = 'production' |
| 59 | |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 60 | return base_config |
[email protected] | 6424466 | 2009-11-12 00:52:08 | [diff] [blame] | 61 | |
Darin Petkov | e17164a | 2010-08-11 20:24:41 | [diff] [blame] | 62 | |
Zdenek Behan | 608f46c | 2011-02-18 23:47:16 | [diff] [blame] | 63 | def _PrepareToServeUpdatesOnly(image_dir, static_dir): |
Chris Sosa | 0356d3b | 2010-09-16 22:46:22 | [diff] [blame] | 64 | """Sets up symlink to image_dir for serving purposes.""" |
| 65 | assert os.path.exists(image_dir), '%s must exist.' % image_dir |
| 66 | # If we're serving out of an archived build dir (e.g. a |
| 67 | # buildbot), prepare this webserver's magic 'static/' dir with a |
| 68 | # link to the build archive. |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 69 | cherrypy.log('Preparing autoupdate for "serve updates only" mode.', |
| 70 | 'DEVSERVER') |
Zdenek Behan | 608f46c | 2011-02-18 23:47:16 | [diff] [blame] | 71 | if os.path.lexists('%s/archive' % static_dir): |
| 72 | if image_dir != os.readlink('%s/archive' % static_dir): |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 73 | cherrypy.log('removing stale symlink to %s' % image_dir, 'DEVSERVER') |
Zdenek Behan | 608f46c | 2011-02-18 23:47:16 | [diff] [blame] | 74 | os.unlink('%s/archive' % static_dir) |
| 75 | os.symlink(image_dir, '%s/archive' % static_dir) |
Chris Sosa | 0356d3b | 2010-09-16 22:46:22 | [diff] [blame] | 76 | else: |
Zdenek Behan | 608f46c | 2011-02-18 23:47:16 | [diff] [blame] | 77 | os.symlink(image_dir, '%s/archive' % static_dir) |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 78 | cherrypy.log('archive dir: %s ready to be used to serve images.' % image_dir, |
| 79 | 'DEVSERVER') |
| 80 | |
| 81 | |
Dale Curtis | c9aaf3a | 2011-08-09 22:47:40 | [diff] [blame^] | 82 | class ApiRoot(object): |
| 83 | """RESTful API for Dev Server information.""" |
| 84 | exposed = True |
| 85 | |
| 86 | @cherrypy.expose |
| 87 | def hostinfo(self, ip): |
| 88 | """Returns a JSON dictionary containing information about the given ip. |
| 89 | |
| 90 | Not all information may be known at the time the request is made. The |
| 91 | possible keys are: |
| 92 | |
| 93 | last_event_type: int |
| 94 | Last update event type received. |
| 95 | |
| 96 | last_event_status: int |
| 97 | Last update event status received. |
| 98 | |
| 99 | last_known_version: string |
| 100 | Last known version recieved for update ping. |
| 101 | |
| 102 | forced_update_label: string |
| 103 | Update label to force next update ping to use. Set by setnextupdate. |
| 104 | |
| 105 | See the OmahaEvent class in update_engine/omaha_request_action.h for status |
| 106 | code definitions. If the ip does not exist an empty string is returned.""" |
| 107 | return updater.HandleHostInfoPing(ip) |
| 108 | |
| 109 | @cherrypy.expose |
| 110 | def setnextupdate(self, ip): |
| 111 | """Allows the response to the next update ping from a host to be set. |
| 112 | |
| 113 | Takes the IP of the host and an update label as normally provided to the |
| 114 | /update command.""" |
| 115 | body_length = int(cherrypy.request.headers['Content-Length']) |
| 116 | label = cherrypy.request.rfile.read(body_length) |
| 117 | |
| 118 | if label: |
| 119 | label = label.strip() |
| 120 | if label: |
| 121 | return updater.HandleSetUpdatePing(ip, label) |
| 122 | raise cherrypy.HTTPError(400, 'No label provided.') |
| 123 | |
| 124 | |
David Rochberg | 7c79a81 | 2011-01-19 19:24:45 | [diff] [blame] | 125 | class DevServerRoot(object): |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 126 | """The Root Class for the Dev Server. |
| 127 | |
| 128 | CherryPy works as follows: |
| 129 | For each method in this class, cherrpy interprets root/path |
| 130 | as a call to an instance of DevServerRoot->method_name. For example, |
| 131 | a call to http://myhost/build will call build. CherryPy automatically |
| 132 | parses http args and places them as keyword arguments in each method. |
| 133 | For paths http://myhost/update/dir1/dir2, you can use *args so that |
| 134 | cherrypy uses the update method and puts the extra paths in args. |
| 135 | """ |
Dale Curtis | c9aaf3a | 2011-08-09 22:47:40 | [diff] [blame^] | 136 | api = ApiRoot() |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 137 | |
David Rochberg | 7c79a81 | 2011-01-19 19:24:45 | [diff] [blame] | 138 | def __init__(self): |
Nick Sanders | 7dcaa2e | 2011-08-04 22:20:41 | [diff] [blame] | 139 | self._builder = None |
David Rochberg | 7c79a81 | 2011-01-19 19:24:45 | [diff] [blame] | 140 | |
Dale Curtis | c9aaf3a | 2011-08-09 22:47:40 | [diff] [blame^] | 141 | @cherrypy.expose |
David Rochberg | 7c79a81 | 2011-01-19 19:24:45 | [diff] [blame] | 142 | def build(self, board, pkg, **kwargs): |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 143 | """Builds the package specified.""" |
Nick Sanders | 7dcaa2e | 2011-08-04 22:20:41 | [diff] [blame] | 144 | import builder |
| 145 | if self._builder is None: |
| 146 | self._builder = builder.Builder() |
David Rochberg | 7c79a81 | 2011-01-19 19:24:45 | [diff] [blame] | 147 | return self._builder.Build(board, pkg, kwargs) |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 148 | |
Dale Curtis | c9aaf3a | 2011-08-09 22:47:40 | [diff] [blame^] | 149 | @cherrypy.expose |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 150 | def index(self): |
| 151 | return 'Welcome to the Dev Server!' |
| 152 | |
Dale Curtis | c9aaf3a | 2011-08-09 22:47:40 | [diff] [blame^] | 153 | @cherrypy.expose |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 154 | def update(self, *args): |
| 155 | label = '/'.join(args) |
| 156 | body_length = int(cherrypy.request.headers['Content-Length']) |
| 157 | data = cherrypy.request.rfile.read(body_length) |
| 158 | return updater.HandleUpdatePing(data, label) |
| 159 | |
Chris Sosa | 0356d3b | 2010-09-16 22:46:22 | [diff] [blame] | 160 | |
Sean O'Connor | 14b6a0a | 2010-03-21 06:23:48 | [diff] [blame] | 161 | if __name__ == '__main__': |
| 162 | usage = 'usage: %prog [options]' |
| 163 | parser = optparse.OptionParser(usage) |
Sean O'Connor | e38ea15 | 2010-04-16 20:50:40 | [diff] [blame] | 164 | parser.add_option('--archive_dir', dest='archive_dir', |
Sean O'Connor | 14b6a0a | 2010-03-21 06:23:48 | [diff] [blame] | 165 | help='serve archived builds only.') |
Chris Sosa | e67b78f1 | 2010-11-05 00:33:16 | [diff] [blame] | 166 | parser.add_option('--board', dest='board', |
| 167 | help='When pre-generating update, board for latest image.') |
Don Garrett | 0c880e2 | 2010-11-18 02:13:37 | [diff] [blame] | 168 | parser.add_option('--clear_cache', action='store_true', default=False, |
Don Garrett | f90edf0 | 2010-11-17 01:36:14 | [diff] [blame] | 169 | help='Clear out all cached udpates and exit') |
Greg Spencer | c8b59b2 | 2011-03-15 21:15:23 | [diff] [blame] | 170 | parser.add_option('--client_prefix', dest='client_prefix_deprecated', |
| 171 | help='No longer used. It is still here so we don\'t break ' |
| 172 | 'scripts that used it.', default='') |
Zdenek Behan | 5d21a2a | 2011-02-12 01:06:01 | [diff] [blame] | 173 | parser.add_option('--data_dir', dest='data_dir', |
| 174 | help='Writable directory where static lives', |
| 175 | default=os.path.dirname(os.path.abspath(sys.argv[0]))) |
Don Garrett | 0c880e2 | 2010-11-18 02:13:37 | [diff] [blame] | 176 | parser.add_option('--exit', action='store_true', default=False, |
| 177 | help='Don\'t start the server (still pregenerate or clear' |
| 178 | 'cache).') |
Andrew de los Reyes | 5262080 | 2010-04-12 20:40:07 | [diff] [blame] | 179 | parser.add_option('--factory_config', dest='factory_config', |
| 180 | help='Config file for serving images from factory floor.') |
Chris Sosa | 4136e69 | 2010-10-29 06:42:37 | [diff] [blame] | 181 | parser.add_option('--for_vm', dest='vm', default=False, action='store_true', |
| 182 | help='Update is for a vm image.') |
Chris Sosa | 0356d3b | 2010-09-16 22:46:22 | [diff] [blame] | 183 | parser.add_option('--image', dest='image', |
| 184 | help='Force update using this image.') |
Chris Sosa | 2c048f1 | 2010-10-27 23:05:27 | [diff] [blame] | 185 | parser.add_option('-p', '--pregenerate_update', action='store_true', |
| 186 | default=False, help='Pre-generate update payload.') |
Don Garrett | 0c880e2 | 2010-11-18 02:13:37 | [diff] [blame] | 187 | parser.add_option('--payload', dest='payload', |
| 188 | help='Use update payload from specified directory.') |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 189 | parser.add_option('--port', default=8080, |
| 190 | help='Port for the dev server to use.') |
Chris Sosa | 0f1ec84 | 2011-02-15 00:33:22 | [diff] [blame] | 191 | parser.add_option('--private_key', default=None, |
| 192 | help='Path to the private key in pem format.') |
Chris Sosa | 417e55d | 2011-01-26 00:40:48 | [diff] [blame] | 193 | parser.add_option('--production', action='store_true', default=False, |
| 194 | help='Have the devserver use production values.') |
Don Garrett | 0ad0937 | 2010-12-07 00:20:30 | [diff] [blame] | 195 | parser.add_option('--proxy_port', default=None, |
| 196 | help='Port to have the client connect to (testing support)') |
Chris Sosa | 62f720b | 2010-10-27 04:39:48 | [diff] [blame] | 197 | parser.add_option('--src_image', default='', |
| 198 | help='Image on remote machine for generating delta update.') |
Sean O'Connor | 1f7fd36 | 2010-04-07 23:34:52 | [diff] [blame] | 199 | parser.add_option('-t', action='store_true', dest='test_image') |
| 200 | parser.add_option('-u', '--urlbase', dest='urlbase', |
| 201 | help='base URL, other than devserver, for update images.') |
Andrew de los Reyes | 5262080 | 2010-04-12 20:40:07 | [diff] [blame] | 202 | parser.add_option('--validate_factory_config', action="store_true", |
| 203 | dest='validate_factory_config', |
| 204 | help='Validate factory config file, then exit.') |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 205 | parser.set_usage(parser.format_help()) |
| 206 | (options, _) = parser.parse_args() |
[email protected] | 21a5ca3 | 2009-11-04 18:23:23 | [diff] [blame] | 207 | |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 208 | devserver_dir = os.path.dirname(os.path.abspath(sys.argv[0])) |
| 209 | root_dir = os.path.realpath('%s/../..' % devserver_dir) |
Chris Sosa | 0356d3b | 2010-09-16 22:46:22 | [diff] [blame] | 210 | serve_only = False |
| 211 | |
Zdenek Behan | 608f46c | 2011-02-18 23:47:16 | [diff] [blame] | 212 | static_dir = os.path.realpath('%s/static' % options.data_dir) |
| 213 | os.system('mkdir -p %s' % static_dir) |
| 214 | |
Sean O'Connor | 14b6a0a | 2010-03-21 06:23:48 | [diff] [blame] | 215 | if options.archive_dir: |
Zdenek Behan | 608f46c | 2011-02-18 23:47:16 | [diff] [blame] | 216 | # TODO(zbehan) Remove legacy support: |
| 217 | # archive_dir is the directory where static/archive will point. |
| 218 | # If this is an absolute path, all is fine. If someone calls this |
| 219 | # using a relative path, that is relative to src/platform/dev/. |
| 220 | # That use case is unmaintainable, but since applications use it |
| 221 | # with =./static, instead of a boolean flag, we'll make this relative |
| 222 | # to devserver_dir to keep these unbroken. For now. |
| 223 | archive_dir = options.archive_dir |
| 224 | if not os.path.isabs(archive_dir): |
| 225 | archive_dir = os.path.realpath(os.path.join(devserver_dir,archive_dir)) |
| 226 | _PrepareToServeUpdatesOnly(archive_dir, static_dir) |
Zdenek Behan | 6d93e55 | 2011-03-02 21:35:49 | [diff] [blame] | 227 | static_dir = os.path.realpath(archive_dir) |
Chris Sosa | 0356d3b | 2010-09-16 22:46:22 | [diff] [blame] | 228 | serve_only = True |
Chris Sosa | 0356d3b | 2010-09-16 22:46:22 | [diff] [blame] | 229 | |
Don Garrett | f90edf0 | 2010-11-17 01:36:14 | [diff] [blame] | 230 | cache_dir = os.path.join(static_dir, 'cache') |
| 231 | cherrypy.log('Using cache directory %s' % cache_dir, 'DEVSERVER') |
| 232 | |
Don Garrett | f90edf0 | 2010-11-17 01:36:14 | [diff] [blame] | 233 | if os.path.exists(cache_dir): |
Chris Sosa | 6b8c374 | 2011-01-31 20:12:17 | [diff] [blame] | 234 | if options.clear_cache: |
| 235 | # Clear the cache and exit on error. |
| 236 | if os.system('rm -rf %s/*' % cache_dir) != 0: |
| 237 | cherrypy.log('Failed to clear the cache with %s' % cmd, |
| 238 | 'DEVSERVER') |
| 239 | sys.exit(1) |
| 240 | |
| 241 | else: |
| 242 | # Clear all but the last N cached updates |
| 243 | cmd = ('cd %s; ls -tr | head --lines=-%d | xargs rm -rf' % |
| 244 | (cache_dir, CACHED_ENTRIES)) |
| 245 | if os.system(cmd) != 0: |
| 246 | cherrypy.log('Failed to clean up old delta cache files with %s' % cmd, |
| 247 | 'DEVSERVER') |
| 248 | sys.exit(1) |
| 249 | else: |
| 250 | os.makedirs(cache_dir) |
Don Garrett | f90edf0 | 2010-11-17 01:36:14 | [diff] [blame] | 251 | |
Greg Spencer | c8b59b2 | 2011-03-15 21:15:23 | [diff] [blame] | 252 | if options.client_prefix_deprecated: |
| 253 | cherrypy.log('The --client_prefix argument is DEPRECATED, ' |
| 254 | 'and is no longer needed.', 'DEVSERVER') |
| 255 | |
Zdenek Behan | 5d21a2a | 2011-02-12 01:06:01 | [diff] [blame] | 256 | cherrypy.log('Data dir is %s' % options.data_dir, 'DEVSERVER') |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 257 | cherrypy.log('Source root is %s' % root_dir, 'DEVSERVER') |
| 258 | cherrypy.log('Serving from %s' % static_dir, 'DEVSERVER') |
[email protected] | 21a5ca3 | 2009-11-04 18:23:23 | [diff] [blame] | 259 | |
Andrew de los Reyes | 5262080 | 2010-04-12 20:40:07 | [diff] [blame] | 260 | updater = autoupdate.Autoupdate( |
| 261 | root_dir=root_dir, |
| 262 | static_dir=static_dir, |
Chris Sosa | 0356d3b | 2010-09-16 22:46:22 | [diff] [blame] | 263 | serve_only=serve_only, |
Andrew de los Reyes | 5262080 | 2010-04-12 20:40:07 | [diff] [blame] | 264 | urlbase=options.urlbase, |
| 265 | test_image=options.test_image, |
| 266 | factory_config_path=options.factory_config, |
Chris Sosa | 5d342a2 | 2010-09-28 23:54:41 | [diff] [blame] | 267 | forced_image=options.image, |
Don Garrett | 0c880e2 | 2010-11-18 02:13:37 | [diff] [blame] | 268 | forced_payload=options.payload, |
Chris Sosa | 62f720b | 2010-10-27 04:39:48 | [diff] [blame] | 269 | port=options.port, |
Don Garrett | 0ad0937 | 2010-12-07 00:20:30 | [diff] [blame] | 270 | proxy_port=options.proxy_port, |
Chris Sosa | 4136e69 | 2010-10-29 06:42:37 | [diff] [blame] | 271 | src_image=options.src_image, |
Chris Sosa | e67b78f1 | 2010-11-05 00:33:16 | [diff] [blame] | 272 | vm=options.vm, |
Chris Sosa | 08d55a2 | 2011-01-20 00:08:02 | [diff] [blame] | 273 | board=options.board, |
Chris Sosa | 0f1ec84 | 2011-02-15 00:33:22 | [diff] [blame] | 274 | copy_to_static_root=not options.exit, |
| 275 | private_key=options.private_key, |
| 276 | ) |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 277 | |
| 278 | # Sanity-check for use of validate_factory_config. |
| 279 | if not options.factory_config and options.validate_factory_config: |
| 280 | parser.error('You need a factory_config to validate.') |
[email protected] | 6424466 | 2009-11-12 00:52:08 | [diff] [blame] | 281 | |
Chris Sosa | 0356d3b | 2010-09-16 22:46:22 | [diff] [blame] | 282 | if options.factory_config: |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 283 | updater.ImportFactoryConfigFile(options.factory_config, |
Chris Sosa | 0356d3b | 2010-09-16 22:46:22 | [diff] [blame] | 284 | options.validate_factory_config) |
Chris Sosa | 7c93136 | 2010-10-12 02:49:01 | [diff] [blame] | 285 | # We don't run the dev server with this option. |
| 286 | if options.validate_factory_config: |
| 287 | sys.exit(0) |
Chris Sosa | 2c048f1 | 2010-10-27 23:05:27 | [diff] [blame] | 288 | elif options.pregenerate_update: |
Chris Sosa | e67b78f1 | 2010-11-05 00:33:16 | [diff] [blame] | 289 | if not updater.PreGenerateUpdate(): |
| 290 | sys.exit(1) |
Chris Sosa | 0356d3b | 2010-09-16 22:46:22 | [diff] [blame] | 291 | |
Don Garrett | 0c880e2 | 2010-11-18 02:13:37 | [diff] [blame] | 292 | # If the command line requested after setup, it's time to do it. |
| 293 | if not options.exit: |
| 294 | cherrypy.quickstart(DevServerRoot(), config=_GetConfig(options)) |