Skip to content

Commit

Permalink
Fixing MyPy issues inside airflow/secrets and airflow/security (#20330)
Browse files Browse the repository at this point in the history
  • Loading branch information
khalidmammadov committed Dec 16, 2021
1 parent bfcaf19 commit 4fc0530
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion airflow/secrets/local_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ def _parse_yaml_file(file_path: str) -> Tuple[Dict[str, List[str]], List[FileSyn
secrets = yaml.safe_load(content)

except yaml.MarkedYAMLError as e:
return {}, [FileSyntaxError(line_no=e.problem_mark.line, message=str(e))]
err_line_no = e.problem_mark.line if e.problem_mark else -1
return {}, [FileSyntaxError(line_no=err_line_no, message=str(e))]
if not isinstance(secrets, dict):
return {}, [FileSyntaxError(line_no=1, message="The file should contain the object.")]

Expand Down
2 changes: 1 addition & 1 deletion airflow/security/kerberos.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def renew_from_kt(principal: Optional[str], keytab: str, exit_on_fail: bool = Tr
# (From: HUE-640). Kerberos clock have seconds level granularity. Make sure we
# renew the ticket after the initial valid time.
time.sleep(1.5)
ret = perform_krb181_workaround(principal)
ret = perform_krb181_workaround(cmd_principal)
if exit_on_fail and ret != 0:
sys.exit(ret)
else:
Expand Down

0 comments on commit 4fc0530

Please sign in to comment.