Removing psycopg2 references

This commit is contained in:
John Westcott IV
2023-05-09 09:26:46 -04:00
committed by John Westcott IV
parent 2b8ed66f3e
commit e47d30974c
7 changed files with 19 additions and 22 deletions

View File

@@ -40,14 +40,13 @@ RUN dnf -y update && dnf install -y 'dnf-command(config-manager)' && \
postgresql-devel \
python3-devel \
python3-pip \
python3-psycopg2 \
python3-setuptools \
swig \
unzip \
xmlsec1-devel \
xmlsec1-openssl-devel
RUN pip3 install virtualenv build
RUN pip3 install virtualenv build psycopg
{% if image_architecture == 'ppc64le' %}
RUN dnf -y update && dnf install -y wget && \
@@ -121,7 +120,6 @@ RUN dnf -y update && dnf install -y 'dnf-command(config-manager)' && \
python3-devel \
python3-libselinux \
python3-pip \
python3-psycopg2 \
python3-setuptools \
rsync \
rsyslog-8.2102.0-106.el9 \
@@ -133,7 +131,7 @@ RUN dnf -y update && dnf install -y 'dnf-command(config-manager)' && \
xmlsec1-openssl && \
dnf -y clean all
RUN pip3 install virtualenv supervisor dumb-init
RUN pip3 install virtualenv supervisor dumb-init psycopg
RUN rm -rf /root/.cache && rm -rf /tmp/*

View File

@@ -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