Skip to content

Commit

Permalink
Logging which host is being used
Browse files Browse the repository at this point in the history
Useful when using multiple hosts with same conn_id and one is defective
  • Loading branch information
mistercrunch committed Jun 4, 2015
1 parent 1fe604f commit b97e478
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion airflow/hooks/base_hook.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import random

from airflow import settings
Expand Down Expand Up @@ -28,7 +29,9 @@ def get_connections(self, conn_id):
return db

def get_connection(self, conn_id):
return random.choice(self.get_connections(conn_id))
conn = random.choice(self.get_connections(conn_id))
logging.info("Using connection to: " + conn.host)
return conn

def get_conn(self):
raise NotImplemented()
Expand Down

0 comments on commit b97e478

Please sign in to comment.