1
0
mirror of https://github.com/projectatomic/atomic.git synced 2026-02-06 21:45:24 +01:00
Commit Graph

18 Commits

Author SHA1 Message Date
Tomas Tomecek
f8cca67556 help: fix pager on python 3
fixes:
```
Traceback (most recent call last):
  File "/home/tt/g/atomic/atomic", line 185, in <module>
    sys.exit(_func())
  File "/home/tt/g/atomic/Atomic/help.py", line 57, in help_tty
    pager(result)
  File "/usr/lib64/python3.6/pydoc.py", line 1421, in pager
    pager(text)
  File "/usr/lib64/python3.6/pydoc.py", line 1438, in <lambda>
    return lambda text: pipepager(text, use_pager)
  File "/usr/lib64/python3.6/pydoc.py", line 1468, in pipepager
    pipe.write(text)
TypeError: write() argument must be str, not bytes
```

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

Closes: #1128
Approved by: giuseppe
2017-11-10 14:37:24 +00:00
Petr Kubat
2ddf2a358b help: add '-t' argument to groff call to preprocess tables
This is done so that atomic help is able to properly print out help files that are using tbl(1) descriptions of tables.

Signed-off-by: Petr Kubat <pkubat@redhat.com>

Closes: #1044
Approved by: giuseppe
2017-07-13 09:55:48 +00:00
Tomas Tomecek
532787bcbe help: prefer help file over label
Fixes #939

Reference: https://pagure.io/atomic-wg/issue/256#comment-436537

* The command now prefers files over "help" label.
 * Help files can be one of:
  * help.1, README.md

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

Closes: #941
Approved by: rhatdan
2017-05-09 15:00:50 +00:00
Tomas Tomecek
805b955ed5 mount: create context manager for {Docker,OSTree}Mount
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

Closes: #976
Approved by: rhatdan
2017-04-24 20:29:15 +00:00
Dan Walsh
5a5e536004 The HELP label by default should be "help"
But we want to check for all cases.  Currently if a image uses the
standard help label, atomic will fail to find it.
2016-11-09 08:45:44 -05:00
Jonathan Lebon
d04d3aa454 test_help.sh: check for groff before testing
Atomic Host variants do not have groff (and most likely never will since
it would pull in a lot of Perl packages). Print out a nicer error if
we're on AH, and make sure to skip that test.

Closes: #684
Approved by: cgwalters
2016-10-13 16:37:01 +00:00
Jonathan Lebon
76b686e289 help.py: fix inverted logic
Closes: #684
Approved by: cgwalters
2016-10-13 16:37:01 +00:00
Dan Walsh
3b486957de Remove primary commands and move to images subcommand
In order to cleanup code and simplify interface, i
move help, info, verify and version to the images subcommand.

Remove man pages for these atomic commands and add info to images subcommand.

Since these have been previously documented we will continue to support
atomic help
atomic info
atomic verify
atomic version

But we will not document them.

Closes: #676
Approved by: rhatdan
2016-10-08 09:46:56 +00:00
Dan Walsh
c0256dcfe6 Implement dbus interface for atomic commands
Add missing interfaces.

Fix functions to return text, rather then displaying directly.

Change atomic_client.py to take input from command line. These args are translated into function calls in python.

Add tests scripts in tests/integration/dbus directory

Closes: #668
Approved by: rhatdan
2016-10-04 14:31:42 +00:00
Dan Walsh
84cc530db2 Move subparser code to submodules.
cli setup should happen in the submodules, for submodules that exist.
Also fix alphabetic order of command verbs.

Closes: #564
Approved by: giuseppe
2016-08-30 10:52:48 +00:00
Dan Walsh
c79c00bf96 Fix up many failures when running atomic with overlay backend
Atomic mount blows up do to badly Camel Case on Graphdriver
Atomic umount blows up because it was not able to remove temporary container
Atomic diff blows up since overlayfs does not mount with a rootfs.
Atomic help blows up also because there is no rootfs directory.

Cleanup atomic help for Overlayfs back end

Closes: #535
Approved by: rhatdan
2016-08-15 20:20:47 +00:00
Dan Walsh
17e887ace7 Lots of cleanups for pylint and python3-lint warnings
Closes: #463
Approved by: jlebon
2016-07-14 22:02:54 +00:00
Brent Baude
04ad0af66e Atomic/atomic.py: Deal with non-ascii input
https://bugzilla.redhat.com/show_bug.cgi?id=1323165#c2 suggests
that atomic install does not deal with non-ascii input very
well.  I believe this addresses the concerns with the proper
UTF-8 encode and decode operations.

Closes: #374
Approved by: rhatdan
2016-05-11 21:27:30 +00:00
Dan Walsh
a8f0e7dca7 Use close_fds=True for all subprocess invocations
The Python default is to keep all FDs open, which is how Unix
traditionally worked. This default behavior is particularly
problematic for the atomic command, which e.g. may
hold a reference to the Docker socket, and we don't
necessarily want to give that reference to all
child processes.

This patch changes most calls to subprocess to be through
util package.  And the util subprocess calls all close_fds=True.

Closes: #370
Approved by: cgwalters
2016-05-03 17:54:31 +00:00
Giuseppe Scrivano
ec646291bc atomic: rename writeOut to write_out
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2016-04-18 20:27:32 +02:00
Brent Baude
570ee912bd Atomic/help.py: cmd_env no longer a property
When the cmd_env defition had its property decorator removed,
a single call to cmd_env in help.py was missed.
2016-02-16 11:11:13 -06:00
Brent Baude
d81e7e651e atomic: harden shell invocations (1248038)
This addresses one of the two issues raised by bugzilla
1248038 where atomic is using shell=True on its subprocess
calls which exposes a security concern.

Two new functions were added to accomplish this.  The
first is a util.chk_call which is similar to util.subp
but it uses the python function check call instead of
Popen.

The second function is atomic.sub_env_strings.  Previously,
there was env variable substitution occuring with cmd_env and
the subprocess call.  That was one upside of the shell=True
usage.  Now, prior to calling util.chk_call, we pass the
intended command to sub_env_strings and use cmd_env to
perform the variable substitution.

We will address part 2 of the security concerns, which
is the handling of LABELS as strings, in a different
PR.
2016-01-29 13:32:22 -06:00
Brent Baude
70427a5159 Atomic/help.py: Display man-like help for an image
Images or containers can now have an associated
man-like help page to help users understand more
about the image.  Typical information included
are things like a longer description, if the image
needs to be installed, security implications, steps
to upgrade, etc.

The default behavior is for atomic to display
a file called help.1 (in man format) located in
the / of the docker object.  This default
can be overriden with the HELP LABEL.  The
HELP LABEL needs to be a fully qualified
command to work correctly.
2016-01-15 10:02:58 -06:00