I am running this code to check whether this directory exists on remote machine or not but this code is checking for the directory on local machine. How can I verify directory on remote machine?
rom fabric.api import run, sudo, env
import os
env.hosts = ['remote_server']
env.user = 'ubuntu'
env.key_filename = '/home/ubuntu/ubuntu16-multi.pem'
def Directory_Check():
DIR_1="/home/ubuntu/test-dir"
if os.path.exists(DIR_1):
print "Directory Exist!"
else:
print "Directory Does Not Exist!"