Hide Forgot
Description of problem: Very minor issue, as usual, a short option is separated by a space from the option argument, e.g. -n ARG or -nARG, but the atomic top -o {time,stime,ppid,uid,gid,user,group} <image> doesn't work. Version-Release number of selected component (if applicable): [cloud-user@plat-infra-4zpfp3 ~]$ sudo atomic host status TIMESTAMP (UTC) VERSION ID OSNAME REFSPEC * 2016-04-12 14:20:45 7.2.3-1 644fcc6035 rhel-atomic-host rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard [cloud-user@plat-infra-4zpfp3 ~]$ rpm -q atomic docker atomic-1.9-4.gitff44c6a.el7.x86_64 docker-1.9.1-25.el7.x86_64 How reproducible: always Steps to Reproduce: 1. docker run -d -it busybox /bin/sh 2. docker ps 3. atomic top -n 2 -o user <container_id> Actual results: [cloud-user@plat-infra-4zpfp3 ~]$ sudo docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 194a92caef3f busybox "/bin/sh" 4 seconds ago Up 3 seconds thirsty_brattain [cloud-user@plat-infra-4zpfp3 ~]$ sudo atomic top -n 2 194a92caef3f|grep bin 194a92caef3f thirsty_brattain 15906 0.1 0.0 0 0 /bin/sh 194a92caef3f thirsty_brattain 15906 0.1 0.0 0 0 /bin/sh [cloud-user@plat-infra-4zpfp3 ~]$ sudo atomic top -n 2 -ouser 194a92caef3f|grep -iA1 user CONTA(I)NER* (N)AME (P)ID (C)PU (M)EM (U)ID (G)ID USER CMD 194a92caef3f thirsty_brattain 15906 0.0 0.0 0 0 root /bin/sh -- CONTA(I)NER* (N)AME (P)ID (C)PU (M)EM (U)ID (G)ID USER CMD 194a92caef3f thirsty_brattain 15906 0.0 0.0 0 0 root /bin/sh [cloud-user@plat-infra-4zpfp3 ~]$ sudo atomic top -n 2 -o=user 194a92caef3f|grep -iA1 user CONTA(I)NER* (N)AME (P)ID (C)PU (M)EM (U)ID (G)ID USER CMD 194a92caef3f thirsty_brattain 15906 0.0 0.0 0 0 root /bin/sh -- CONTA(I)NER* (N)AME (P)ID (C)PU (M)EM (U)ID (G)ID USER CMD 194a92caef3f thirsty_brattain 15906 0.0 0.0 0 0 root /bin/sh [cloud-user@plat-infra-4zpfp3 ~]$ sudo atomic top -n 2 -o user 194a92caef3f|grep -iA1 user /bin/atomic: argument -o/--optional: invalid choice: '194a92caef3f' (choose from 'time', 'stime', 'ppid', 'uid', 'gid', 'user', 'group') Try 'atomic top --help' for more information. NOTE: the short option should be separated by a space not '=' from the option argument Expected results: Additional info: In addtion, it seems we have implemented many -o/--optional options[1], but it only supports {time,stime,ppid,uid,gid,user,group} options in -o/--optional now. [1] [root@dell-per630-02 atomic]# grep "'shortname':" Atomic/top.py {'shortname': '%CPU', 'column': '(C)PU', 'character': 'c', 'sort': True, 'index': 3, {'shortname': 'CID', 'column': 'CONTA(I)NER', 'character': 'i', 'sort': True, 'index': 0, {'shortname': 'NAME', 'column': '(N)AME', 'character': 'n', 'sort': True, 'index': 1, {'shortname': 'PID', 'column': '(P)ID', 'character': 'p', 'sort': True, 'index': 2, {'shortname': '%MEM', 'column': '(M)EM', 'character': 'm', 'sort': True, 'index': 4, {'shortname': 'CMD', 'column': 'CMD', 'character': None, 'sort': False, 'index': 99, {'shortname': 'TIME', 'column': '(T)IME', 'character': 't', 'sort': True, 'index': 6, {'shortname': 'STIME', 'column': '(S)TIME', 'character': 's', 'sort': True, 'index': 7, {'shortname': 'PPID', 'column': 'PPI(D)', 'character': 'd', 'sort': True, 'index': 8, {'shortname': 'UID', 'column': '(U)ID', 'character': 'u', 'sort': True, 'index': 9, {'shortname': 'GID', 'column': '(G)ID', 'character': 'g', 'sort': True, 'index': 10, {'shortname': 'USER', 'column': 'USER', 'character': None, 'sort': False, 'index': 11, {'shortname': 'GROUP', 'column': 'GROUP', 'character': None, 'sort': False, 'index': 12, It's a trivial matter, so I think we may fix them in one patch.
Seems to work correctly in current release. Fixed in atomic-1.10.
(In reply to Daniel Walsh from comment #2) > Seems to work correctly in current release. > > Fixed in atomic-1.10. It still doesn't work for me. [cloud-user@atomic-host-001 ~]$ rpm -q atomic atomic-1.10.5-7.el7.x86_64 [cloud-user@atomic-host-001 ~]$ sudo atomic top -n 2 -o user 391f5e6bb67a /usr/bin/atomic: argument -o/--optional: invalid choice: '391f5e6bb67a' (choose from 'time', 'stime', 'ppid', 'uid', 'gid', 'user', 'group') Try 'atomic top --help' for more information.
Could you check atomic-1.11
(In reply to Daniel Walsh from comment #4) > Could you check atomic-1.11 It also doesn't work on upstream atomic. [root@dhcp-2-50 atomic]# git rev-parse HEAD 70c51001c07311aec1b72079e9c1917af80bcd3c [root@dhcp-2-50 atomic]# ./atomic top -n 2 -o user a5ffa272e45a atomic top: argument -o/--optional: invalid choice: 'a5ffa272e45a' (choose from 'time', 'stime', 'ppid', 'uid', 'gid', 'user', 'group') Try 'atomic top --help' for more information.
Alex see if this fixes the issue for you https://github.com/projectatomic/atomic/pull/569
(In reply to Daniel Walsh from comment #6) > Alex see if this fixes the issue for you > > https://github.com/projectatomic/atomic/pull/569 Daniel, it works well for me.
Fixed in atomic-1.12
This bug has been fixed in atomic-1.12.0-1.el7.x86_64, so moving to VERIFIED status.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-2628.html