I am working in python script (windows located) to remotely execute (another) script in a linux server. I need to change the directory and keep the state for executing the script and after research I found fabric's help could resolve the problem. However it hits pylint error:
E1129:Context manager 'generator' doesn't implement __enter__ and __exit__.and
Found some comments to this problem like the ones here, however I do not get the point, not sure what is happening and how to resolve. As far as I understood the fabric context manager cd works along with the "with" statement, many examples look like my code, few people reports a solution for this behaviour, or it is me who is a beginner does not understand. I am using VSCode as IDE, python 3.7 and fabric3. Hope you can help me to clarify what is happening. Thank you!
This is the code I am using now:
from fabric.api import cd, run, task, run, env
from fabric.context_managers import cd
env.hosts = ['xxx@server.domain.com:22']
env.password = ['myp@ss']
DIR = 'elfar/elfar'
def go_to_script():
with cd(DIR):
run("ls")