| Summary: | atomic install on non-Atomic OS always says too few arguments | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Jan Pazdziora <jpazdziora> | |
| Component: | atomic | Assignee: | Lokesh Mandvekar <lsm5> | |
| Status: | CLOSED DUPLICATE | QA Contact: | atomic-bugs <atomic-bugs> | |
| Severity: | unspecified | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | 7.3 | CC: | ajia, bbaude, dwalsh, jpazdziora | |
| Target Milestone: | rc | Keywords: | Regression | |
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | ||
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1375719 (view as bug list) | Environment: | ||
| Last Closed: | 2016-09-13 20:29:13 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
It's weird for me, I can successfully install rhel7 w/ atomic-1.12.0-1.el7.x86_64 and docker-1.10.3-53.el7.x86_64 on my RHEL7.2 system. [root@dhcp-2-50 ~]# atomic install rhel7 Using default tag: latest Trying to pull repository registry.access.redhat.com/rhel7 ... latest: Pulling from registry.access.redhat.com/rhel7 ee4aeaf2fc2d: Pull complete Digest: sha256:8bedcf1091d26337900510275d268f7aa817026f3327c91620ca266c2cc26924 Status: Downloaded newer image for registry.access.redhat.com/rhel7:latest [root@dhcp-2-50 ~]# rpm -q atomic docker atomic-1.12.0-1.el7.x86_64 docker-1.10.3-53.el7.x86_64 The message gets printed from
except AttributeError:
# python3 throws exception on no args to atomic
if aparser:
aparser.print_usage()
else:
traceback.print_exc(file=sys.stdout)
sys.exit(1)
When I run the print_exc unconditionally, I get
Traceback (most recent call last):
File "/usr/bin/atomic", line 184, in <module>
sys.exit(_func())
File "/usr/lib/python2.7/site-packages/Atomic/install.py", line 87, in install
elif self.args.setvalues:
AttributeError: 'Namespace' object has no attribute 'setvalues'
Adding import argparse to /usr/lib/python2.7/site-packages/Atomic/containers.py (Atomic/containers.py) seems to fix the issue. In upstream it was added via 48c1d2519c75cec10fd5f447977f7b0ae23c3d22. Please backport the whole commit or just that one-line import change. I spoke too fast, this does not seem to fix the issue. So the problem is only present if the ostree package is not available, like on non-Atomic RHEL installation.
When ostree is installed, the
if OSTREE_PRESENT:
in /usr/lib/python2.7/site-packages/Atomic/install.py kicks in and
installp.add_argument("--set", dest="setvalues",
action='append',
help=_("Specify a variable in the VARIABLE=VALUE "
"form for a system container"))
is used.
Does full quality image name works for you? If you want do pull registry.access.redhat.com/rhel7 image w/ short name in RHEL7 system, you should append ADD_REGISTRY='--add-registry registry.access.redhat.com' into /etc/sysconfig/docker and restart docker service, I assume you haven't do this, otherwise, please ignore this. [root@dhcp-2-50 ~]# atomic install registry.access.redhat.com/rhel7 Using default tag: latest Trying to pull repository registry.access.redhat.com/rhel7 ... latest: Pulling from registry.access.redhat.com/rhel7 ee4aeaf2fc2d: Pull complete Digest: sha256:8bedcf1091d26337900510275d268f7aa817026f3327c91620ca266c2cc26924 Status: Downloaded newer image for registry.access.redhat.com/rhel7:latest [root@dhcp-2-50 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.2 (Maipo) [root@dhcp-2-50 ~]# rpm -q atomic docker atomic-1.12.0-1.el7.x86_64 docker-1.10.3-54.el7.x86_64 I met the same issue for atomic install although I used full quality image name. # atomic install registry.access.redhat.com/rhel7/sadc /usr/bin/atomic install registry.access.redhat.com/rhel7/sadc: too few arguments Try '/usr/bin/atomic install registry.access.redhat.com/rhel7/sadc --help' for more information. could you retry with the latest 1.12.1 https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=513056 looks like the latest build has this issue has well. |
Description of problem: Help for atomic install command says # atomic install --help usage: atomic install [-h] [-n NAME] [--display] image ... positional arguments: image container image args Additional arguments appended to the image install method optional arguments: -h, --help show this help message and exit -n NAME, --name NAME name of container --display preview the command that /usr/bin/atomic would execute atomic install attempts to read the LABEL INSTALL field in the image, if it does not exist atomic will just pull the image on to your machine. You could add a LABEL INSTALL command to your Dockerfile like: 'LABEL INSTALL docker run -t -i --rm --privileged -v /:/host --net=host --ipc=host --pid=host -e HOST=/host -e NAME=${NAME} -e IMAGE=${IMAGE} -e CONFDIR=/host/etc/${NAME} -e LOGDIR=/host/var/log/${NAME} -e DATADIR=/host/var/lib/${NAME} --name ${NAME} ${IMAGE} /usr/bin/INSTALLCMD' The atomic 1.12 says too few arguments, even if image is provided. Version-Release number of selected component (if applicable): atomic-1.12.0-1.el7.x86_64 How reproducible: Deterministic. Steps to Reproduce: 1. atomic install rhel7 Actual results: # atomic install rhel7 /usr/bin/atomic install rhel7: too few arguments Try '/usr/bin/atomic install rhel7 --help' for more information. # /usr/bin/atomic install rhel7 --help /usr/bin/atomic install rhel7 --help: too few arguments Try '/usr/bin/atomic install rhel7 --help --help' for more information. Expected results: No error about too few arguments, the default docker run is executed. Additional info: