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

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
 
 
   
 
----------------------------------------------------------------
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:
us...@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)

Reply via email to