# Path: nuka/tasks/file.py
# class exists(Task):
# class mkdir(Task):
# class mkdirs(Task):
# class rm(Task):
# class mv(Task):
# class chmod(Task):
# class chown(Task):
# class put(Task):
# class scripts(put):
# class cat(Task):
# class update(Task):
#     def __init__(self, dst=None, **kwargs):
#     def do(self):
#     def diff(self):
#     def __init__(self, dst=None, mod=None, own=None, **kwargs):
#     def do(self):
#     def diff(self):
#     def __init__(self, directories=None, **kwargs):
#     def do(self):
#     def diff(self):
#     def __init__(self, dst=None, **kwargs):
#     def do(self):
#     def diff(self):
#     def __init__(self, src=None, dst=None, **kwargs):
#     def do(self):
#     def diff(self):
#     def __init__(self, dst=None, mod='644', recursive=False, **kwargs):
#     def do(self):
#     def __init__(self, dst=None, own='root:root', recursive=False, **kwargs):
#     def do(self):
#     def __init__(self, files=None, **kwargs):
#     def pre_process(self):
#     def do(self):
#     def diff(self):
#     def do(self):
#     def __init__(self, src=None, **kwargs):
#     def do(self):
#     def __init__(self, dst=None, replaces=None, appends=None, **kwargs):
#     def pre_process(self):
#     def update(self, data):
#     def do(self):
#     def diff(self, dst=None, **kwargs):
# 
# Path: nuka/hosts/base.py
# class Host(BaseHost):
#     """A host. Used by tasks as target"""
# 
#     def __init__(self, *args, **kwargs):
#         super().__init__(*args, **kwargs)
#         if not os.getenv('SSH_AUTH_SOCK'):
#             self.log.warning('No SSH_AUTH_SOCK set. Your tasks may freeze')
# 
#     def wraps_command_line(self, cmd, **kwargs):
#         ssh_user = kwargs.get('switch_ssh_user')
#         if ssh_user is None:
#             # we use the main user account
#             switch_user = kwargs.get('switch_user') or 'root'
#             if switch_user != 'root':
#                 if switch_user != self.vars['user']:
#                     # we have to use sudo
#                     args = (switch_user, cmd)
#                     if self.use_sudo:
#                         cmd = '{sudo} -u {0} {1}'.format(*args, **nuka.config)
#                     else:
#                         cmd = '{su} -c "{1}" {0}'.format(*args, **nuka.config)
#             elif self.use_sudo:
#                 cmd = '{sudo} {0}'.format(cmd, **nuka.config)
# 
#         if ssh_user is None:
#             ssh_user = self.vars['user']
# 
#         ssh_cmd = ['ssh'] + nuka.config['ssh']['options'] + ['-l', ssh_user]
#         if self.port:
#             ssh_cmd.extend(['-p', self.port])
#         ssh_cmd.extend([self.hostname, cmd])
#         return ssh_cmd


import nuka
from nuka.tasks import file
from nuka.hosts import Host
'''
Usage: cat hostlist | python from_stdin.py
'''


async def do(host):
    res = await file.cat('/etc/debian_version')
    print(res.content)


# Path: nuka/tasks/file.py
# class exists(Task):
# class mkdir(Task):
# class mkdirs(Task):
# class rm(Task):
# class mv(Task):
# class chmod(Task):
# class chown(Task):
# class put(Task):
# class scripts(put):
# class cat(Task):
# class update(Task):
#     def __init__(self, dst=None, **kwargs):
#     def do(self):
#     def diff(self):
#     def __init__(self, dst=None, mod=None, own=None, **kwargs):
#     def do(self):
#     def diff(self):
#     def __init__(self, directories=None, **kwargs):
#     def do(self):
#     def diff(self):
#     def __init__(self, dst=None, **kwargs):
#     def do(self):
#     def diff(self):
#     def __init__(self, src=None, dst=None, **kwargs):
#     def do(self):
#     def diff(self):
#     def __init__(self, dst=None, mod='644', recursive=False, **kwargs):
#     def do(self):
#     def __init__(self, dst=None, own='root:root', recursive=False, **kwargs):
#     def do(self):
#     def __init__(self, files=None, **kwargs):
#     def pre_process(self):
#     def do(self):
#     def diff(self):
#     def do(self):
#     def __init__(self, src=None, **kwargs):
#     def do(self):
#     def __init__(self, dst=None, replaces=None, appends=None, **kwargs):
#     def pre_process(self):
#     def update(self, data):
#     def do(self):
#     def diff(self, dst=None, **kwargs):
# 
# Path: nuka/hosts/base.py
# class Host(BaseHost):
#     """A host. Used by tasks as target"""
# 
#     def __init__(self, *args, **kwargs):
#         super().__init__(*args, **kwargs)
#         if not os.getenv('SSH_AUTH_SOCK'):
#             self.log.warning('No SSH_AUTH_SOCK set. Your tasks may freeze')
# 
#     def wraps_command_line(self, cmd, **kwargs):
#         ssh_user = kwargs.get('switch_ssh_user')
#         if ssh_user is None:
#             # we use the main user account
#             switch_user = kwargs.get('switch_user') or 'root'
#             if switch_user != 'root':
#                 if switch_user != self.vars['user']:
#                     # we have to use sudo
#                     args = (switch_user, cmd)
#                     if self.use_sudo:
#                         cmd = '{sudo} -u {0} {1}'.format(*args, **nuka.config)
#                     else:
#                         cmd = '{su} -c "{1}" {0}'.format(*args, **nuka.config)
#             elif self.use_sudo:
#                 cmd = '{sudo} {0}'.format(cmd, **nuka.config)
# 
#         if ssh_user is None:
#             ssh_user = self.vars['user']
# 
#         ssh_cmd = ['ssh'] + nuka.config['ssh']['options'] + ['-l', ssh_user]
#         if self.port:
#             ssh_cmd.extend(['-p', self.port])
#         ssh_cmd.extend([self.hostname, cmd])
#         return ssh_cmd


# Path: examples/from_stdin.py
import nuka
from nuka.tasks import file
from nuka.hosts import Host

'''
Usage: cat hostlist | python from_stdin.py
'''


async def do(host):
    res = await file.cat('/etc/debian_version')
    print(res.content)


nuka.run_all(do, *Host.from_stdin())