summaryrefslogtreecommitdiff
path: root/contrib/python
Commit message (Collapse)AuthorAge
* Move python code from contrib to it's own repo python-podmanJhon Honce2019-01-10
| | | | Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Switch all referencs to image.ContainerConfig to image.ConfigDaniel J Walsh2018-12-21
| | | | | | This will more closely match what Docker is doing. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* all flakes must diebaude2018-12-18
| | | | | | | when cleaning up after a test, don't fail if cleanup doesn't run perfectly. Signed-off-by: baude <bbaude@redhat.com>
* Merge pull request #1893 from jwhonce/bug/1869OpenShift Merge Robot2018-12-07
|\ | | | | Refactor CLI booleans to be consistent and defined behavior
| * Refactor BooleanAction to mimic golang interfaceJhon Honce2018-12-05
| | | | | | | | | | | | | | | | | | | | * Change all store_true or store_false to use store_bool. New behavior documented in BooleanAction docstring. * Remove any extraneous code identified by pylint in files from above. Fixes #1869 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | Invert tlsverify default in APIJhon Honce2018-12-05
|/ | | | | | Fixes #1929 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Merge pull request #1894 from jwhonce/bug/1876OpenShift Merge Robot2018-12-04
|\ | | | | Only include container SizeRootFs when requested
| * Only include container SizeRootFs when requestedJhon Honce2018-11-28
| | | | | | | | | | | | | | | | * API always returns value, so we remove it if not asked for Fixes #1876 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | pypod create/run: ignore args for container commandEd Santiago2018-11-28
|/ | | | | | | | | | | | | Don't try to argparse command-line arguments on the right-hand side of the image; those are intended for the container command: pypodman create fedora ls -l pypodman run fedora find / -name foo pypodman run fedora bash -c 'echo hi' If/when `pypodman exec` gets implemented, it should use this too. Signed-off-by: Ed Santiago <santiago@redhat.com>
* Merge pull request #1851 from jwhonce/wip/cmdOpenShift Merge Robot2018-11-28
|\ | | | | Add support for --all in pypodman ps command
| * Add support for --all in pypodman ps commandJhon Honce2018-11-28
| | | | | | | | | | | | | | | | * Updated field widths to match changes in go code Fixes #1654 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | Merge pull request #1885 from edsantiago/split_token_noneOpenShift Merge Robot2018-11-28
|\ \ | | | | | | _split_token(): handle None
| * | _split_token(): handle NoneEd Santiago2018-11-27
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The conditional + list comprehension in images.py:_split_token() wasn't quite working as intended; in particular, when fed None, it chokes with TypeError: 'NoneType' object is not iterable This is the correct behavior: comprehensions iterate first, then apply the conditional. Solution: special-case None, and remove the now-unnecessary conditional. Context: seen when trying 'pypodman run' against docker.io/stackbrew/centos:7, which has no .ContainerConfig.Eng Signed-off-by: Ed Santiago <santiago@redhat.com>
* / Fixes #1867Jhon Honce2018-11-28
|/ | | | | | * Some items included in the CLI and currently not supported by the API. Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Actually set version for podman module / pypodmanAnders F Björklund2018-11-25
| | | | | | | | | | The environment variable wasn't set, giving 0.0.0 It is a still a problem if you use python3 to build, rather than make. You *need* to set $PODMAN_VERSION, or your module and packages won't have the version. Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
* Improve speed of containers.list()Jhon Honce2018-11-19
| | | | | | | | * Clean up code in containers.py * Pass pylint tests * Pass tox tests Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Merge pull request #1824 from afbjorklund/pypodman_userOpenShift Merge Robot2018-11-19
|\ | | | | pypodman: Don't use $HOST and $USER variables for remote
| * Don't use $HOST and $USER variables for remoteAnders F Björklund2018-11-18
| | | | | | | | | | | | | | | | | | | | Also, don't use $PORT. These are too generic. Make sure to read $LOGNAME _after_ the config. Prefix all the remote variables with PODMAN_ Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
* | Implement pypodman start commandJhon Honce2018-11-16
|/ | | | | | | | | * Improve error messages from argparse Actions * Silence more pylint errors when supporting a given API * Refactor BooleanAction to support lower and mixed case input * Remove spurious print() Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Add version command to pypodmanDaniel J Walsh2018-11-15
| | | | | | | | | | pypodman does not currently support the version command. We want to have as close to the same functionality between podman and pypodman, so adding this command. Also had to fix some validate errors. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Temporarily fix the Python tests to fix some PRsMatthew Heon2018-11-07
| | | | | | | | | | | | | | | | | The Python podman bindings have issues around kill - specifically attempting to make it act like stop, when it should not. We provide no guarantee of what state a container if in after kill - it should be stopped, but we might have sent something that's not SIGKILL. If you want a container or pod stopped, guaranteed, use Stop(). The Python code attempted to ensure a container was actually stopped after kill was run, which runs counter the above. This was holding up some PRs that caused changes in how libpod obtains its state, so for now, change pod kill to pod stop until the proper changes in the Python code can be made. Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* Merge pull request #1743 from jwhonce/issue/1702OpenShift Merge Robot2018-11-05
|\ | | | | Add ChangeAction to parse sub-options from --change
| * Add ChangeAction to parse sub-options from --changeJhon Honce2018-11-01
| | | | | | | | | | | | | | | | | | | | * Covers both commit and import commands * Cleaned up export command * Removed unneeded calls to super().__init__() Fixes #1702 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | Fix long image name handlingJhon Honce2018-11-01
|/ | | | | | | | * Fixed issue where podman printed '<none>' and pypodman skipped the image * Fixed issue where port was printed in place of tags Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Change humanize to use MB vs MiB.Jhon Honce2018-11-01
| | | | | | Fixes #1653 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Ensure test container in running stateJhon Honce2018-10-25
| | | | | | | | * Save storage if tests fail Fixes #1643 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Downgrade code to support python3.4Jhon Honce2018-10-23
| | | | | | | | | | | * Added tox configuration to test python 3.4, 3.5 and 3.6. Tox testing not enabled on every PR * Updated MANIFEST.ini to support tox * Correct comments Fixes #1641 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Revert "Cirrus: Enable debugging delay on non-zero exit"Chris Evich2018-10-18
| | | | | | This reverts commit b610913ef55ac36d0b145a7d20461649650cc5a1. Signed-off-by: Chris Evich <cevich@redhat.com>
* Cirrus: Enable debugging delay on non-zero exitChris Evich2018-10-15
| | | | | | | | | | There have been some python-podman flakes observed across multiple CI systems. Support capturing a VM for further investigation in the event of a non-zero exit. This is done by printing a warning message and delaying script-exit for a long time. Hopefully a human will notice and have an opportunity to enable deletion-protection on the VM. Signed-off-by: Chris Evich <cevich@redhat.com>
* tests: do not fail in the cleanup phaseGiuseppe Scrivano2018-10-14
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Add support for pod commandsJhon Honce2018-10-12
| | | | | | | | | | | | | | * Add support for pod -- create, inspect, kill, pause, ps, rm, restart, start, stop, top, unpause * Update pylintrc to better reflect pep8 code standards * Fix various pylint reported errors * Refactor code that determines screen width to no longer require initializing curses. Improved start up time and pushing data blob down ssh tunnel. * Correct pod-create man page, cgroupparent not boolean * Abort integration tests if podman service fails to start Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Fix python testsMatthew Heon2018-10-02
| | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* * Update documenationJhon Honce2018-10-01
| | | | Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Implement pod varlink bindingsJhon Honce2018-10-01
| | | | | | | | | | | | * Update varlink document * Add NoContainersInPod error in go and python * Add support for varlink pod interface * New code passes pylint * Fix bug in test_runner.sh * Update integration tests for race condition on status check * Add missing port config file support Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Merge pull request #818 from wking/python-2-cleanMatthew Heon2018-09-27
|\ | | | | Makefile: Call contrib/python's clean regardless of HAS_PYTHON3
| * contrib/python/*/Makefile: Fallback to unversioned 'python'W. Trevor King2018-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And pull these from the PATH by default. This way systems like CentOS that don't have a python3 can still execute 'make clean', which doesn't care about the Python major version. The setup.py shebang, mode change, and ./ prefixing helps address cases where PYTHON is empty. This could be the result of improper user configuration: $ make PYTHON='' clean It could also be the state on systems with no Python installed, in which case you'll see: $ make PYTHON='' clean ./setup.py clean --all /usr/bin/env: 'python': No such file or directory make: *** [Makefile:13: clean] Error 127 I've also shifted the Python invocations to the end of the clean recipies so that as much as possible gets cleaned up even on systems without Python installed. Signed-off-by: W. Trevor King <wking@tremily.us>
* | Updates from reviewsJhon Honce2018-09-21
| | | | | | | | | | | | | | Signed-off-by: Jhon Honce <jhonce@redhat.com> Closes: #1519 Approved by: rhatdan
* | Implement new subcommandsJhon Honce2018-09-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Refactor create subparser to share arguments with run subparser * Add argparse.*Action subclasses to reduce duplicate code in parsers * Using BooleanAction now accept True/False value as expected * .pylintrc added to loosen variable name policing * Update AbstractBaseAction to remove unset arguments before transmitting to podman service * Align logging messages to podman output * Renamed global argument from --user to --username, to avoid conflict with create/run podman commands * Add new subcommands: run, create, history, import, info, push, restart and search Signed-off-by: Jhon Honce <jhonce@redhat.com> Closes: #1519 Approved by: rhatdan
* | Don't output inodes created to run a containerDaniel J Walsh2018-09-21
|/ | | | | | | | | | | | | | | | | | | | | | | | | | There is a group of inodes that get created when running a container if they do not exist. containerMounts = map[string]bool{ "/dev": true, "/etc/hostname": true, "/etc/hosts": true, "/etc/resolv.conf": true, "/proc": true, "/run": true, "/run/.containerenv": true, "/run/secrets": true, "/sys": true, } If the destination inode does not exist, libpod/runc will create the inode. This can cause programs like podman diff to see the image as having changed, when actually it has not. This patch ignores changes in these inodes. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1508 Approved by: giuseppe
* Turn on test debuggingJhon Honce2018-08-31
| | | | | | | Signed-off-by: Jhon Honce <jhonce@redhat.com> Closes: #1369 Approved by: rhatdan
* Add support for remote commandsJhon Honce2018-08-31
| | | | | | | | | | | | | | * Add support for commit, export, inspect, kill, logs, mount, pause port commands * Refactored Report class to allow column lengths to be optionally driven by data * Refactored Ps class to truncate image names on the left vs right * Bug fixes Signed-off-by: Jhon Honce <jhonce@redhat.com> Closes: #1369 Approved by: rhatdan
* Add retry decorator for flakey testsJhon Honce2018-08-20
| | | | | | | | | * Update doc strings Signed-off-by: Jhon Honce <jhonce@redhat.com> Closes: #1302 Approved by: baude
* Update error message from reviewsJhon Honce2018-08-20
| | | | | | | Signed-off-by: Jhon Honce <jhonce@redhat.com> Closes: #1296 Approved by: rhatdan
* Support Attach subcommand in pypodmanJhon Honce2018-08-20
| | | | | | | | | * Fix some random error handling Signed-off-by: Jhon Honce <jhonce@redhat.com> Closes: #1296 Approved by: rhatdan
* Fix handling of socket connection refusal.Daniel J Walsh2018-08-17
| | | | | | | | | | | | | | | Currently if the socket was never started you get an error about the service being started. But if the service was started and later stopped, you get a useless error. This change causes the error to always be the same for connection refused. The error message was also repeating the address twice which looked bad. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1287 Approved by: baude
* switch projectatomic to containersDaniel J Walsh2018-08-16
| | | | | | | | | | Need to get some small changes into libpod to pull back into buildah to complete buildah transition. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1270 Approved by: mheon
* Add create and pull commandsJhon Honce2018-08-14
| | | | | | | | | | | * Rename id_ to ident, make non-PEP8'ers happier * Fix bug where port was required on local connections * Improve error messages for exceptions Signed-off-by: Jhon Honce <jhonce@redhat.com> Closes: #1246 Approved by: rhatdan
* Fix python tests againMatthew Heon2018-08-10
| | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* Fix python tests to use cgroupfsMatthew Heon2018-08-10
| | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* Force cgroupfs for python testsMatthew Heon2018-08-10
| | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com>