Commit Graph

12 Commits (7ffed6f6dc8db39cfdc0f2c411cec1058c2199ac)

Author SHA1 Message Date
David Wilson 1f77d24bec Update copyright year everywhere. 7 years ago
David Wilson 0e193c223c issue #508: master: minify all Mitogen/ansible_mitogen sources.
Minify-safe files are marked with a magical "# !mitogen: minify_safe"
comment anywhere in the file, which activates the minifier. The result
is naturally cached by ModuleResponder, therefore lru_cache is gone too.

Given:

    import os, mitogen
    @mitogen.main()
    def main(router):
        c = router.ssh(hostname='k3')
        c.call(os.getpid)
        router.sudo(via=c)

SSH footprint drops from 56.2 KiB to 42.75 KiB (-23.9%)
Ansible "shell: hostname" drops 149.26 KiB to 117.42 KiB (-21.3%)
7 years ago
David Wilson ec789513dc ssh: tidy up logs and stream names. 7 years ago
David Wilson de7d4e0908 setns: decode utility command output for 3.x. 7 years ago
David Wilson 42f07466d2 setns: always assume a user identity, default to root.
Without this, an invocation like:

    sudo ansible-playbook foo.yml

Where foo.yml uses setns, could inherit the HOME environment variable
from the external non-root user, which broke /usr/bin/mysql_upgrade and
plenty more.
7 years ago
David Wilson 81c8156965 Support LXD; closes #339. 7 years ago
David Wilson 24ecfb3b13 Fix setns.py syntax for 3.x 8 years ago
David Wilson 410016ff47 Initial Python 3.x port work.
* ansible: use unicode_literals everywhere since it only needs to be
  compatible back to 2.6.
* compat/collections.py: delete this entirely and rip out the parts of
  functools that require it.
* Introduce serializable Kwargs dict subclass that translates keys to
  Unicode on instantiation.
* enable_debug_logging() must set _v/_vv globals.
* cStringIO does not exist in 3.x.
* Treat IOLogger and LogForwarder input as latin-1.
* Avoid ResourceWarnings in first stage by explicitly closing fps.
* Fix preamble_size.py syntax errors.
8 years ago
David Wilson 7f1060f54a issue #186: initial version of subtree detachment. 8 years ago
David Wilson fdac4ecce8 setns: typos 8 years ago
David Wilson 7c5bbc5168 setns: support changing user.
To match existing third party plugin.
8 years ago
David Wilson e8b4c4e683 issue #223: implement setns connection type
machinectl does not support any sensible form of pipe to the child
process, so it is necessary to bypass it when talking to a systemd
container (see systemd/systemd#8850).

This can also form the basis for issue #223, where the post-fork
namespace switching dance required to connect to the Pythonless
container will be the same.
8 years ago