Skip to content

Commit

Permalink
fixing a bug in logging an extract run (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
DevanathanSabapathy1 authored Feb 5, 2024
1 parent e96f24c commit f99a67a
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions core/extract/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,27 @@ def main():
sys.exit("Failed to load driver")

# setting application name for tracking
application = "WorkloadReplicator-Extract"

host = config.get("source_cluster_endpoint").split(".")[0]
port = int(config.get("source_cluster_endpoint").split(":")[-1].split("/")[0])
DbUser = config.get("master_username")
DbName = config.get("source_cluster_endpoint").split("/")[-1]
region = config.get("region")
endpoint = config.get('source_cluster_endpoint').split(":")[0]

response = aws_service_helper.redshift_get_cluster_credentials(
user=DbUser,
database_name=DbName,
cluster_id=host,
region=region)
db_connect(host=endpoint,
port=port,
database=DbName,
password=response['DbPassword'],
username=response['DbUser'], app_name=application)
if config.get("source_cluster_endpoint"):
application = "WorkloadReplicator-Extract"

host = config.get("source_cluster_endpoint").split(".")[0]
port = int(config.get("source_cluster_endpoint").split(":")[-1]
.split("/")[0])
DbUser = config.get("master_username")
DbName = config.get("source_cluster_endpoint").split("/")[-1]
region = config.get("region")
endpoint = config.get('source_cluster_endpoint').split(":")[0]

response = aws_service_helper.redshift_get_cluster_credentials(
user=DbUser,
database_name=DbName,
cluster_id=host,
region=region)
db_connect(host=endpoint,
port=port,
database=DbName,
password=response['DbPassword'],
username=response['DbUser'], app_name=application)

# Run extract job
(
Expand Down

0 comments on commit f99a67a

Please sign in to comment.