You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ohad (Jira)" <ji...@apache.org> on 2019/12/30 15:30:00 UTC
[jira] [Updated] (AIRFLOW-6402) SSH operator exception - 'NoneType'
object has no attribute 'startswith'
[ https://issues.apache.org/jira/browse/AIRFLOW-6402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ohad updated AIRFLOW-6402:
--------------------------
Summary: SSH operator exception - 'NoneType' object has no attribute 'startswith' (was: SSH operator exceotion - 'NoneType' object has no attribute 'startswith')
> SSH operator exception - 'NoneType' object has no attribute 'startswith'
> ------------------------------------------------------------------------
>
> Key: AIRFLOW-6402
> URL: https://issues.apache.org/jira/browse/AIRFLOW-6402
> Project: Apache Airflow
> Issue Type: Bug
> Components: operators
> Affects Versions: 1.10.7
> Reporter: ohad
> Assignee: ohad
> Priority: Critical
> Attachments: ddd.png
>
>
> Hi
> I found a bug in the constructor off the new airflow (1.10.7).
> It's affects me when I am implementing my own operator (I'ts inherit from SshOperator)
> The default value for the "self.command" variable is None, while this line of code cant run because of the default value:
> {code:java}
> self.get_pty = self.command.startswith('sudo') or get_pty {code}
> My solution right now (In my plugin) is to send value of empty string to the constructor:
> {code:java}
> super().__init__(command='', *args, **kwargs){code}
> instead of:
> {code:java}
> super().__init__(*args, **kwargs){code}
> The problematic file is (line 83):
> {code:java}
> /v1-10-stable/airflow/contrib/operators/ssh_operator.py {code}
>
> !ddd.png!
> Thanks
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)