summaryrefslogtreecommitdiffstats
path: root/tools/scripts/firehose.py
diff options
context:
space:
mode:
authorJohn Westcott IV <john.westcott.iv@redhat.com>2023-05-09 15:26:46 +0200
committerJohn Westcott IV <32551173+john-westcott-iv@users.noreply.github.com>2023-06-14 23:40:15 +0200
commite47d30974ce1f71d1ad2d6bd0f3d81bf1f70fad6 (patch)
treeb22bb88696ba659a9e7cc684093bffab55fdef87 /tools/scripts/firehose.py
parentUpdating old migration for psycopg3 (diff)
downloadawx-e47d30974ce1f71d1ad2d6bd0f3d81bf1f70fad6.tar.xz
awx-e47d30974ce1f71d1ad2d6bd0f3d81bf1f70fad6.zip
Removing psycopg2 references
Diffstat (limited to '')
-rwxr-xr-xtools/scripts/firehose.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/scripts/firehose.py b/tools/scripts/firehose.py
index 2eeeb5da7b..e23287a5b8 100755
--- a/tools/scripts/firehose.py
+++ b/tools/scripts/firehose.py
@@ -38,7 +38,7 @@ from io import StringIO
from time import time
from uuid import uuid4
-import psycopg2
+import psycopg
from django import setup as setup_django
from django.db import connection
@@ -111,7 +111,7 @@ class YieldedRows(StringIO):
def firehose(job, count, created_stamp, modified_stamp):
- conn = psycopg2.connect(dsn)
+ conn = psycopg.connect(dsn)
f = YieldedRows(job, count, created_stamp, modified_stamp)
with conn.cursor() as cursor:
cursor.copy_expert(
@@ -133,7 +133,7 @@ def firehose(job, count, created_stamp, modified_stamp):
def cleanup(sql):
print(sql)
- conn = psycopg2.connect(dsn)
+ conn = psycopg.connect(dsn)
with conn.cursor() as cursor:
cursor.execute(sql)
conn.commit()
@@ -221,7 +221,7 @@ def generate_jobs(jobs, batch_size, time_delta):
def generate_events(events, job, time_delta):
- conn = psycopg2.connect(dsn)
+ conn = psycopg.connect(dsn)
cursor = conn.cursor()
created_time = datetime.datetime.today() - time_delta - datetime.timedelta(seconds=5)
@@ -282,7 +282,7 @@ if __name__ == '__main__':
days_delta = params.days_delta
batch_size = params.batch_size
try:
- conn = psycopg2.connect(dsn)
+ conn = psycopg.connect(dsn)
cursor = conn.cursor()
# Drop all the indexes before generating jobs