|
|
@ -42,12 +42,12 @@ Enable it by:
|
|
|
|
EOF
|
|
|
|
EOF
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
import mitogen.master
|
|
|
|
from __future__ import absolute_import
|
|
|
|
import mitogen.unix
|
|
|
|
|
|
|
|
from mitogen.ansible import helpers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import ansible.errors
|
|
|
|
import ansible.errors
|
|
|
|
import ansible.plugins.connection
|
|
|
|
import ansible.plugins.connection
|
|
|
|
|
|
|
|
import ansible_mitogen.helpers
|
|
|
|
|
|
|
|
import mitogen.unix
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Connection(ansible.plugins.connection.ConnectionBase):
|
|
|
|
class Connection(ansible.plugins.connection.ConnectionBase):
|
|
|
@ -78,15 +78,15 @@ class Connection(ansible.plugins.connection.ConnectionBase):
|
|
|
|
super(Connection, self).exec_command(cmd, in_data=in_data, sudoable=sudoable)
|
|
|
|
super(Connection, self).exec_command(cmd, in_data=in_data, sudoable=sudoable)
|
|
|
|
if in_data:
|
|
|
|
if in_data:
|
|
|
|
raise ansible.errors.AnsibleError("does not support module pipelining")
|
|
|
|
raise ansible.errors.AnsibleError("does not support module pipelining")
|
|
|
|
return self.py_call(helpers.exec_command, cmd, in_data)
|
|
|
|
return self.py_call(ansible_mitogen.helpers.exec_command, cmd, in_data)
|
|
|
|
|
|
|
|
|
|
|
|
def fetch_file(self, in_path, out_path):
|
|
|
|
def fetch_file(self, in_path, out_path):
|
|
|
|
output = self.py_call(helpers.read_path, in_path)
|
|
|
|
output = self.py_call(ansible_mitogen.helpers.read_path, in_path)
|
|
|
|
helpers.write_path(out_path, output)
|
|
|
|
ansible_mitogen.helpers.write_path(out_path, output)
|
|
|
|
|
|
|
|
|
|
|
|
def put_file(self, in_path, out_path):
|
|
|
|
def put_file(self, in_path, out_path):
|
|
|
|
self.py_call(helpers.write_path, out_path,
|
|
|
|
self.py_call(ansible_mitogen.helpers.write_path, out_path,
|
|
|
|
helpers.read_path(in_path))
|
|
|
|
ansible_mitogen.helpers.read_path(in_path))
|
|
|
|
|
|
|
|
|
|
|
|
def close(self):
|
|
|
|
def close(self):
|
|
|
|
self.router.broker.shutdown()
|
|
|
|
self.router.broker.shutdown()
|