[IMP] Specify the type int for the port and the netport
bzr revid: stephane@tinyerp.com-20081224002822-uys2zrs1qeh5q2pl
This commit is contained in:
parent
203194ce45
commit
d9be84059d
|
@ -143,12 +143,7 @@ if tools.config["stop_after_init"]:
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
|
|
||||||
if tools.config['xmlrpc']:
|
if tools.config['xmlrpc']:
|
||||||
try:
|
port = int(tools.config['port'])
|
||||||
port = int(tools.config["port"])
|
|
||||||
except:
|
|
||||||
logger.notifyChannel("init", netsvc.LOG_CRITICAL,
|
|
||||||
"invalid port: %r" % (tools.config["port"],))
|
|
||||||
sys.exit(1)
|
|
||||||
interface = tools.config["interface"]
|
interface = tools.config["interface"]
|
||||||
secure = tools.config["secure"]
|
secure = tools.config["secure"]
|
||||||
|
|
||||||
|
@ -168,14 +163,8 @@ if tools.config['xmlrpc']:
|
||||||
#
|
#
|
||||||
|
|
||||||
if tools.config['netrpc']:
|
if tools.config['netrpc']:
|
||||||
try:
|
netport = int(tools.config['netport'])
|
||||||
netport = int(tools.config["netport"])
|
|
||||||
except:
|
|
||||||
logger.notifyChannel("init", netsvc.LOG_ERROR,
|
|
||||||
"invalid port '%s'!" % (tools.config["netport"],))
|
|
||||||
sys.exit(1)
|
|
||||||
netinterface = tools.config["netinterface"]
|
netinterface = tools.config["netinterface"]
|
||||||
|
|
||||||
tinySocket = netsvc.TinySocketServerThread(netinterface, netport, False)
|
tinySocket = netsvc.TinySocketServerThread(netinterface, netport, False)
|
||||||
logger.notifyChannel("web-services", netsvc.LOG_INFO,
|
logger.notifyChannel("web-services", netsvc.LOG_INFO,
|
||||||
"starting NET-RPC service, port %d" % (netport,))
|
"starting NET-RPC service, port %d" % (netport,))
|
||||||
|
|
|
@ -42,9 +42,9 @@ class configmanager(object):
|
||||||
self.options = {
|
self.options = {
|
||||||
'email_from':False,
|
'email_from':False,
|
||||||
'interface': '', # this will bind the server to all interfaces
|
'interface': '', # this will bind the server to all interfaces
|
||||||
'port': '8069',
|
'port': 8069,
|
||||||
'netinterface': '',
|
'netinterface': '',
|
||||||
'netport': '8070',
|
'netport': 8070,
|
||||||
'db_host': False,
|
'db_host': False,
|
||||||
'db_port': False,
|
'db_port': False,
|
||||||
'db_name': False,
|
'db_name': False,
|
||||||
|
@ -91,9 +91,9 @@ class configmanager(object):
|
||||||
parser.add_option("--pidfile", dest="pidfile", help="file where the server pid will be stored")
|
parser.add_option("--pidfile", dest="pidfile", help="file where the server pid will be stored")
|
||||||
|
|
||||||
parser.add_option("-n", "--interface", dest="interface", help="specify the TCP IP address")
|
parser.add_option("-n", "--interface", dest="interface", help="specify the TCP IP address")
|
||||||
parser.add_option("-p", "--port", dest="port", help="specify the TCP port")
|
parser.add_option("-p", "--port", dest="port", help="specify the TCP port", type="int")
|
||||||
parser.add_option("--net_interface", dest="netinterface", help="specify the TCP IP address for netrpc")
|
parser.add_option("--net_interface", dest="netinterface", help="specify the TCP IP address for netrpc")
|
||||||
parser.add_option("--net_port", dest="netport", help="specify the TCP port for netrpc")
|
parser.add_option("--net_port", dest="netport", help="specify the TCP port for netrpc", type="int")
|
||||||
parser.add_option("--no-netrpc", dest="netrpc", action="store_false", default=True, help="disable netrpc")
|
parser.add_option("--no-netrpc", dest="netrpc", action="store_false", default=True, help="disable netrpc")
|
||||||
parser.add_option("--no-xmlrpc", dest="xmlrpc", action="store_false", default=True, help="disable xmlrpc")
|
parser.add_option("--no-xmlrpc", dest="xmlrpc", action="store_false", default=True, help="disable xmlrpc")
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ class configmanager(object):
|
||||||
group = optparse.OptionGroup(parser, "SMTP Configuration")
|
group = optparse.OptionGroup(parser, "SMTP Configuration")
|
||||||
group.add_option('--email-from', dest='email_from', default='', help='specify the SMTP email address for sending email')
|
group.add_option('--email-from', dest='email_from', default='', help='specify the SMTP email address for sending email')
|
||||||
group.add_option('--smtp', dest='smtp_server', default='', help='specify the SMTP server for sending email')
|
group.add_option('--smtp', dest='smtp_server', default='', help='specify the SMTP server for sending email')
|
||||||
group.add_option('--smtp-port', dest='smtp_port', default='25', help='specify the SMTP port')
|
group.add_option('--smtp-port', dest='smtp_port', default='25', help='specify the SMTP port', type="int")
|
||||||
if hasSSL:
|
if hasSSL:
|
||||||
group.add_option('--smtp-ssl', dest='smtp_ssl', default='', help='specify the SMTP server support SSL or not')
|
group.add_option('--smtp-ssl', dest='smtp_ssl', default='', help='specify the SMTP server support SSL or not')
|
||||||
group.add_option('--smtp-user', dest='smtp_user', default='', help='specify the SMTP username for sending email')
|
group.add_option('--smtp-user', dest='smtp_user', default='', help='specify the SMTP username for sending email')
|
||||||
|
@ -142,7 +142,7 @@ class configmanager(object):
|
||||||
group.add_option("-w", "--db_password", dest="db_password", help="specify the database password")
|
group.add_option("-w", "--db_password", dest="db_password", help="specify the database password")
|
||||||
group.add_option("--pg_path", dest="pg_path", help="specify the pg executable path")
|
group.add_option("--pg_path", dest="pg_path", help="specify the pg executable path")
|
||||||
group.add_option("--db_host", dest="db_host", help="specify the database host")
|
group.add_option("--db_host", dest="db_host", help="specify the database host")
|
||||||
group.add_option("--db_port", dest="db_port", help="specify the database port")
|
group.add_option("--db_port", dest="db_port", help="specify the database port", type="int")
|
||||||
group.add_option("--db_maxconn", dest="db_maxconn", default='64', help="specify the the maximum number of physical connections to posgresql")
|
group.add_option("--db_maxconn", dest="db_maxconn", default='64', help="specify the the maximum number of physical connections to posgresql")
|
||||||
group.add_option("-P", "--import-partial", dest="import_partial", help="Use this for big data importation, if it crashes you will be able to continue at the current state. Provide a filename to store intermediate importation states.", default=False)
|
group.add_option("-P", "--import-partial", dest="import_partial", help="Use this for big data importation, if it crashes you will be able to continue at the current state. Provide a filename to store intermediate importation states.", default=False)
|
||||||
parser.add_option_group(group)
|
parser.add_option_group(group)
|
||||||
|
|
Loading…
Reference in New Issue