Use type='int' for --port argument. Also cookbook->chemdb auth realm.
authorW. Trevor King <wking@drexel.edu>
Wed, 25 Aug 2010 16:56:21 +0000 (12:56 -0400)
committerW. Trevor King <wking@drexel.edu>
Wed, 25 Aug 2010 16:56:21 +0000 (12:56 -0400)
chemdb/server.py

index aadc551bc506792907eecc041d5236d81fe5e1f3..2db25a3153534becb7122b519e813dc0b9befb3f 100644 (file)
@@ -254,7 +254,7 @@ class ServerDaemon (Daemon):
         p.add_option('-a', '--address', dest='address', default='127.0.0.1',
                      metavar='ADDR',
                      help='Address that the server will bind to (%default).')
-        p.add_option('-p', '--port', dest='port', default='8080',
+        p.add_option('-p', '--port', dest='port', default=8080, type='int',
                      metavar='PORT',
                      help='Port that the server will listen on (%default).')
         p.add_option('-s', '--secure', dest="secure",
@@ -320,7 +320,7 @@ class ServerDaemon (Daemon):
         if cherrypy.__version__.startswith('3.'):
             cherrypy.config.update({ # http://www.cherrypy.org/wiki/ConfigAPI
                     'server.socket_host': self.options.address,
-                    'server.socket_port': int(self.options.port),
+                    'server.socket_port': self.options.port,
                     'tools.decode.on': True,
                     'tools.encode.on': True,
                     'tools.encode.encoding': 'utf8',
@@ -336,7 +336,7 @@ class ServerDaemon (Daemon):
                 else:
                     digest_auth = {
                         'tools.auth_digest.on': True,
-                        'tools.auth_digest.realm': 'cookbook',
+                        'tools.auth_digest.realm': 'chemdb',
                         'tools.auth_digest.get_ha1': get_ha1,
                         'tools.auth_digest.key': str(uuid.uuid4()),
                         }
@@ -352,7 +352,7 @@ class ServerDaemon (Daemon):
                 else:
                     digest_auth = {
                         'tools.digest_auth.on': True,
-                        'tools.digest_auth.realm': 'cookbook',
+                        'tools.digest_auth.realm': 'chemdb',
                         'tools.digest_auth.users': passwds,
                         }
             app_config = {