mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
flake8: E402 module level import not at top of file.
This commit is contained in:
committed by
Dan Christian Bogos
parent
f7452fd697
commit
33fa773a0b
@@ -6,6 +6,15 @@
|
||||
# ^ the script will "move" the collections if source and target server are the same
|
||||
# but will "copy" (dump/restore) if source and target servers are different
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from collections import OrderedDict
|
||||
from urllib import quote_plus
|
||||
|
||||
from pymongo import MongoClient
|
||||
|
||||
from_host = '127.0.0.1'
|
||||
from_port = '27017'
|
||||
from_db = '11'
|
||||
@@ -31,11 +40,6 @@ drop_target = False
|
||||
|
||||
dump_folder = 'dump'
|
||||
|
||||
import sys
|
||||
from pymongo import MongoClient
|
||||
from urllib import quote_plus
|
||||
from collections import OrderedDict
|
||||
|
||||
# same server
|
||||
if from_host == to_host and from_port == to_port:
|
||||
print('Migrating on same server...')
|
||||
@@ -68,10 +72,6 @@ if from_host == to_host and from_port == to_port:
|
||||
|
||||
# different servers
|
||||
else:
|
||||
import subprocess
|
||||
import os
|
||||
import shutil
|
||||
|
||||
print('Migrating between different servers...')
|
||||
print('Dumping...')
|
||||
out = subprocess.check_output([
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
# behaviour:
|
||||
# ^ the script will not overwrite keys on the destination server/database
|
||||
|
||||
import time
|
||||
|
||||
import redis
|
||||
|
||||
from_host = '127.0.0.1'
|
||||
from_port = 6379
|
||||
from_db = 11
|
||||
@@ -21,9 +25,6 @@ to_pass = '' # Not used
|
||||
keymask = '*'
|
||||
timeout = 2000
|
||||
|
||||
import time
|
||||
import redis
|
||||
|
||||
from_redis = redis.Redis(host = from_host, port = from_port, password=from_pass, db = from_db)
|
||||
to_redis = redis.Redis(host = to_host, port = to_port, db = to_db)
|
||||
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
# depends:
|
||||
# ^ mysql (debian: python-mysql.connector)
|
||||
|
||||
import mysql.connector
|
||||
|
||||
host = '127.0.0.1'
|
||||
port = 3306
|
||||
database = 'cgrates'
|
||||
user = 'root'
|
||||
password = 'CGRateS.org'
|
||||
|
||||
import mysql.connector
|
||||
|
||||
config = {
|
||||
'user': user,
|
||||
'password': password,
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
# depends:
|
||||
# ^ psycopg2 (debian: python-psycopg2)
|
||||
|
||||
import psycopg2
|
||||
|
||||
host = '127.0.0.1'
|
||||
port = 5432
|
||||
database = 'cgrates'
|
||||
user = 'cgrates'
|
||||
password = 'CGRateS.org'
|
||||
|
||||
import psycopg2
|
||||
|
||||
print('Connecting to PostgreSQL...')
|
||||
cnx = psycopg2.connect(
|
||||
host=host,
|
||||
|
||||
Reference in New Issue
Block a user