You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/12/30 15:23:00 UTC

[jira] [Commented] (AIRFLOW-6402) SSH operator exceotion - 'NoneType' object has no attribute 'startswith'

    [ https://issues.apache.org/jira/browse/AIRFLOW-6402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17005391#comment-17005391 ] 

ASF GitHub Bot commented on AIRFLOW-6402:
-----------------------------------------

ohadmata commented on pull request #6969: [\[AIRFLOW-6402\]](https://issues.apache.org/jira/browse/AIRFLOW-6402) SSH operator exception - 'NoneType' object has no attribute 'startswith'
URL: https://github.com/apache/airflow/pull/6969
 
 
   fix ssh operator constructor
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> SSH operator exceotion - '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)