##// END OF EJS Templates
rc-commands: python3 port
super-admin -
r5078:b8ca8ea6 default
parent child Browse files
Show More
@@ -24,6 +24,7 b' import pyramid.paster'
24
24
25 from rhodecode.lib.pyramid_utils import bootstrap, get_app_config
25 from rhodecode.lib.pyramid_utils import bootstrap, get_app_config
26 from rhodecode.lib.db_manage import DbManage
26 from rhodecode.lib.db_manage import DbManage
27 from rhodecode.lib.utils2 import get_encryption_key
27 from rhodecode.model.db import Session
28 from rhodecode.model.db import Session
28
29
29
30
@@ -93,8 +94,9 b' def command(ini_path, force_yes, user, e'
93 config = get_app_config(ini_path)
94 config = get_app_config(ini_path)
94
95
95 db_uri = config['sqlalchemy.db1.url']
96 db_uri = config['sqlalchemy.db1.url']
97 enc_key = get_encryption_key(config)
96 dbmanage = DbManage(log_sql=True, dbconf=db_uri, root='.',
98 dbmanage = DbManage(log_sql=True, dbconf=db_uri, root='.',
97 tests=False, cli_args=options)
99 tests=False, cli_args=options, enc_key=enc_key)
98 if skip_existing_db and dbmanage.db_exists():
100 if skip_existing_db and dbmanage.db_exists():
99 return
101 return
100
102
@@ -25,7 +25,7 b' import pyramid.paster'
25
25
26 from rhodecode.lib.pyramid_utils import bootstrap
26 from rhodecode.lib.pyramid_utils import bootstrap
27 from rhodecode.lib.db_manage import DbManage
27 from rhodecode.lib.db_manage import DbManage
28 from rhodecode.lib.utils2 import safe_int
28 from rhodecode.lib.utils2 import safe_int, get_encryption_key
29
29
30 log = logging.getLogger(__name__)
30 log = logging.getLogger(__name__)
31
31
@@ -46,10 +46,11 b' def command(ini_path, force_yes, force_v'
46 with bootstrap(ini_path, env={'RC_CMD_UPGRADE_DB': '1'}) as env:
46 with bootstrap(ini_path, env={'RC_CMD_UPGRADE_DB': '1'}) as env:
47 config = env['registry'].settings
47 config = env['registry'].settings
48 db_uri = config['sqlalchemy.db1.url']
48 db_uri = config['sqlalchemy.db1.url']
49 enc_key = get_encryption_key(config)
49 options = {}
50 options = {}
50 if force_yes is not None:
51 if force_yes is not None:
51 options['force_ask'] = force_yes
52 options['force_ask'] = force_yes
52 dbmanage = DbManage(
53 dbmanage = DbManage(
53 log_sql=True, dbconf=db_uri, root='.', tests=False,
54 log_sql=True, dbconf=db_uri, root='.', tests=False,
54 cli_args=options)
55 cli_args=options, enc_key=enc_key)
55 dbmanage.upgrade(version=safe_int(force_version))
56 dbmanage.upgrade(version=safe_int(force_version))
General Comments 0
You need to be logged in to leave comments. Login now