rc-commands: python3 port

This commit is contained in:
RhodeCode Admin 2023-07-18 11:43:31 +02:00
parent 4b95e6f0c6
commit a637b39cbf
2 changed files with 6 additions and 3 deletions

View file

@ -24,6 +24,7 @@ import pyramid.paster
from rhodecode.lib.pyramid_utils import bootstrap, get_app_config
from rhodecode.lib.db_manage import DbManage
from rhodecode.lib.utils2 import get_encryption_key
from rhodecode.model.db import Session
@ -93,8 +94,9 @@ def command(ini_path, force_yes, user, email, password, api_key, repos,
config = get_app_config(ini_path)
db_uri = config['sqlalchemy.db1.url']
enc_key = get_encryption_key(config)
dbmanage = DbManage(log_sql=True, dbconf=db_uri, root='.',
tests=False, cli_args=options)
tests=False, cli_args=options, enc_key=enc_key)
if skip_existing_db and dbmanage.db_exists():
return

View file

@ -25,7 +25,7 @@ import pyramid.paster
from rhodecode.lib.pyramid_utils import bootstrap
from rhodecode.lib.db_manage import DbManage
from rhodecode.lib.utils2 import safe_int
from rhodecode.lib.utils2 import safe_int, get_encryption_key
log = logging.getLogger(__name__)
@ -46,10 +46,11 @@ def command(ini_path, force_yes, force_version):
with bootstrap(ini_path, env={'RC_CMD_UPGRADE_DB': '1'}) as env:
config = env['registry'].settings
db_uri = config['sqlalchemy.db1.url']
enc_key = get_encryption_key(config)
options = {}
if force_yes is not None:
options['force_ask'] = force_yes
dbmanage = DbManage(
log_sql=True, dbconf=db_uri, root='.', tests=False,
cli_args=options)
cli_args=options, enc_key=enc_key)
dbmanage.upgrade(version=safe_int(force_version))