postgres use postgres instead of template1 and template1 instead of template0

bzr revid: al@openerp.com-20120209213317-3tt4o0sj87764ocn
This commit is contained in:
Antony Lesuisse 2012-02-09 22:33:17 +01:00
parent 80f9a1e770
commit a1e5c645d9
2 changed files with 6 additions and 6 deletions

View File

@ -117,7 +117,7 @@ class db(netsvc.ExportService):
return fn(*params)
def _create_empty_database(self, name):
db = sql_db.db_connect('template1')
db = sql_db.db_connect('postgres')
cr = db.cursor()
chosen_template = tools.config['db_template']
try:
@ -176,7 +176,7 @@ class db(netsvc.ExportService):
openerp.modules.registry.RegistryManager.delete(db_name)
sql_db.close_db(db_name)
db = sql_db.db_connect('template1')
db = sql_db.db_connect('postgres')
cr = db.cursor()
cr.autocommit(True) # avoid transaction block
try:
@ -278,7 +278,7 @@ class db(netsvc.ExportService):
openerp.modules.registry.RegistryManager.delete(old_name)
sql_db.close_db(old_name)
db = sql_db.db_connect('template1')
db = sql_db.db_connect('postgres')
cr = db.cursor()
cr.autocommit(True) # avoid transaction block
try:
@ -306,7 +306,7 @@ class db(netsvc.ExportService):
raise openerp.exceptions.AccessDenied()
chosen_template = tools.config['db_template']
templates_list = tuple(set(['template0', 'template1', 'postgres', chosen_template]))
db = sql_db.db_connect('template1')
db = sql_db.db_connect('postgres')
cr = db.cursor()
try:
try:
@ -544,7 +544,7 @@ GNU Public Licence.
return http_server.list_http_services()
def exp_check_connectivity(self):
return bool(sql_db.db_connect('template1'))
return bool(sql_db.db_connect('postgres'))
def exp_get_os_time(self):
return os.times()

View File

@ -223,7 +223,7 @@ class configmanager(object):
help="specify the database port", type="int")
group.add_option("--db_maxconn", dest="db_maxconn", type='int', my_default=64,
help="specify the the maximum number of physical connections to posgresql")
group.add_option("--db-template", dest="db_template", my_default="template0",
group.add_option("--db-template", dest="db_template", my_default="template1",
help="specify a custom database template to create a new database")
parser.add_option_group(group)