GRAYBYTE WORDPRESS FILE MANAGER2367

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib//lve_create_db.py
# coding=utf-8
#
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT

import logging
from lvestats.lib import dbengine
from lvestats.lib.commons.logsetup import setup_logging
from lvestats.lib.server_id import UpdateOrCreateServerID


def configure_db(configuration, opts):
    log = setup_logging(configuration, 'create_db', console_level=logging.INFO)
    log.info('Configuring connection to db')
    try:
        engine = dbengine.make_db_engine(configuration, just_print=opts.print_sql)
    except dbengine.MakeDbException as e:
        log.error(str(e))
    else:
        _configure_db(configuration, engine, log, opts)


def _configure_db(configuration, engine, log, opts):
    if opts.validate:
        validation = dbengine.validate_database(engine)
        if not (validation['column_error'] or validation['table_error']):
            log.info("Database structure is correct")
    elif opts.fix:
        log.info('Try fix errors in database')
        dbengine.fix_db(engine, configuration, log_=log)
    # Re-create DB
    elif opts.recreate:
        log.info('Recreate DB')
        dbengine.recreate_db(engine)
    # Create DB if no params
    else:
        log.info('Creating tables')
        dbengine.setup_db(engine, cfg=configuration)
        log.info('Done')
    if opts.create_missing_tables:
        dbengine.setup_db(engine, create_missing_tables=True, cfg=configuration)

    # Update server_id manually
    if opts.update_serverid_prompt:
        log.info('Updating server ID')
        UpdateOrCreateServerID(engine).prompt()
        log.info('Done')
    # Update server_id (if server_id in restricted list) automatically
    elif opts.update_serverid_auto:
        log.info('Updating server ID with uuid')
        UpdateOrCreateServerID(engine).auto()
        log.info('Done')

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
January 01 1970 00:00:00
root / root
0
__pycache__
--
June 20 2025 08:30:33
root / root
0755
bursting
--
June 20 2025 08:30:33
root / root
0755
chart
--
June 20 2025 08:30:33
root / root
0755
commons
--
June 20 2025 08:30:33
root / root
0755
info
--
June 20 2025 08:30:33
root / root
0755
parsers
--
June 20 2025 08:30:33
root / root
0755
__init__.py
0.214 KB
May 30 2025 10:30:46
root / root
0644
cloudlinux_statistics.py
24.873 KB
May 30 2025 10:30:46
root / root
0644
cloudlinux_statsnotifier.py
5.092 KB
May 30 2025 10:30:46
root / root
0644
config.py
3.203 KB
May 30 2025 10:30:46
root / root
0644
db_functions.py
1.452 KB
May 30 2025 10:30:46
root / root
0644
dbengine.py
10.572 KB
May 30 2025 10:30:46
root / root
0644
jsonhandler.py
0.433 KB
May 30 2025 10:30:46
root / root
0644
lve_create_db.py
1.881 KB
May 30 2025 10:30:46
root / root
0644
lve_list.py
3.352 KB
May 30 2025 10:30:46
root / root
0644
lveinfolib.py
41.82 KB
May 30 2025 10:30:46
root / root
0644
lveinfolib_gov.py
13.563 KB
May 30 2025 10:30:46
root / root
0644
lvestats_server.py
8.463 KB
May 30 2025 10:30:46
root / root
0644
notifications_helper.py
5.411 KB
May 30 2025 10:30:46
root / root
0644
server_id.py
5.141 KB
May 30 2025 10:30:46
root / root
0644
snapshot.py
7.419 KB
May 30 2025 10:30:46
root / root
0644
uidconverter.py
5.011 KB
May 30 2025 10:30:46
root / root
0644
ustate.py
8.616 KB
May 30 2025 10:30:46
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF