I'm trying to restart my core service through Python. This is my code:
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname='123.456.789.876', username='username', password='password', key_filename='/path/to/.ssh/id_rsa')
print ssh.Popen("service core restart", shell=True, stdout=ssh.PIPE).stdout.read()
When I run it I get AttributeError: 'SSHClient' object has no attribute 'Popen'
. What am I doing wrong?