Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AIRFLOW-1850] Copy cmd before masking #2817

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion airflow/contrib/hooks/sqoop_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from airflow.exceptions import AirflowException
from airflow.hooks.base_hook import BaseHook
from airflow.utils.log.logging_mixin import LoggingMixin
from copy import deepcopy


class SqoopHook(BaseHook, LoggingMixin):
Expand Down Expand Up @@ -70,7 +71,8 @@ def __init__(self, conn_id='sqoop_default', verbose=False,
def get_conn(self):
return self.conn

def cmd_mask_password(self, cmd):
def cmd_mask_password(self, cmd_orig):
cmd = deepcopy(cmd_orig)
try:
password_index = cmd.index('--password')
cmd[password_index + 1] = 'MASKED'
Expand Down