Bug #4547
closed
CLI: Foreman should split the name, major and minor versions for an OS in the output
Added by Og Maciel over 11 years ago.
Updated over 5 years ago.
Description
Cannot search for an OS by name using the CLI. This is because even though hammer displays the name for an OS as the concat of name + major +minor, list --search expects only name as an argument.
[root@qeblade35 ~]# hammer os list
------------------------------------------------------------------
ID | NAME | RELEASE NAME | FAMILY
------------------------------------------------------------------
6 | 2mp6jb 9.5 | |
13 | 3424745990 9.8 | |
19 | 5622196256 7.5 | |
24 | 6757407487 9.1 | |
14 | 6SAtVmf522 3.6 | |
15 | <sub>CfZFFCsGWQ</sub> 4.6 | |
16 | GyACSEVlUr 4.9 | |
25 | ONy1SAC7zL 7.6 | |
26 | PPBFAAaZKU 4.0 | |
1 | RedHat 6.5 | | Redhat
20 | VLykOkmCvI 4.6 | |
23 | aZTLXI8uyF 0.2 | |
7 | awkv4l 9.3 | |
4 | e800bdk6 4.10 | |
9 | evf7un1y 5.10 | |
10 | i9wscn 2.10 | |
31 | mrk8sa1 9.10 | |
2 | t55wifg 7.0 | |
30 | tvdxyujs 4.2 | |
8 | vcjrs5f 0.8 | |
------------------------------------------------------------------
[root@qeblade35 ~]# hammer os list --search name='mrk8sa1 9.10'
No data.
[root@qeblade35 ~]# hammer os list --search name='mrk8sa1'
-----------------------------------------------------
ID | NAME | RELEASE NAME | FAMILY
-----------------------------------------------------
31 | mrk8sa1 9.10 | |
-----------------------------------------------------
Calling this column "name" is slightly misleading, it's called "full_name" in Foreman itself I think, but it doesn't appear that this is a searchable field. The OS model design is a mess unfortunately.
The issue has been cleared by migrating to Scoped Search.
[root@myserver ~]# hammer os list
---|----------------------------------------------------------------------------------|--------------|-------
ID | TITLE | RELEASE NAME | FAMILY
---|----------------------------------------------------------------------------------|--------------|-------
6 | 629038801211 462 | |
15 | <abbr>EOOkYEhWrcSRIUTTIwgFoxlacbeIFqTGkBglkXfmjBVLvCDvtpSiOyNBQuigZui</abbr> 42 | |
10 | FikNZvqGuopONuVWjUJvqvfSXKcCCowiqSWvhrEmemZLDG 26628 | |
9 | K9znAViDzWK1t7ldjQHbp1cmVPUDiZCKfHr32CFsqjgYmaSo49ilgtLEtq9IEPkoly7qKrgjRfvH5... | |
8 | <p>cPDouqRjZIlxyvOEPjicqzBjxSvlBNRYswYgqfs</p> 1 | |
1 | RHEL Server 7.2 | | Redhat
5 | ûèßãÓÀÞçÉÝÉõâÉàããëØüáðúÊüúøÀÈÀúßÅËäþÛæÆÞÂÏÉæÒýéúíüÃæÑñýÉéÒÌÜáìÛóóòóôÞßóåÍÊÕÙç... | |
2 | UGkcuOh1MhWdCB17VRbDNjjw0nv2ta2S1yCdFPn9K8BmSpHPR327mv2UGN30t29xpTJXvp3jD64Ei... | |
3 | VRGoHHQWhvsxhAhaWLEitDYaumwTFHtDxlKrIfFYtlwKebcCiBaxmmPveHvAUPivZQUvkGEQiSldj... | |
7 | 𡰼𧖠𨗰ꗡ𧡧𧶿멩斎茐𤦯𐤳𐠥 714 | |
4 | 顭戟氀巺祋歍帉麞杖慦矆剱螳鎼縲楼焥峍衏篟奉羉烇噰鮟悉鯁傸伒螈耴襌 81661 | |
---|----------------------------------------------------------------------------------|--------------|-------
[root@myserver ~]# hammer os list --search='title="RHEL Server 7.2"'
---|-----------------|--------------|-------
ID | TITLE | RELEASE NAME | FAMILY
---|-----------------|--------------|-------
1 | RHEL Server 7.2 | | Redhat
---|-----------------|--------------|-------
roman plevka wrote:
The issue has been cleared by migrating to Scoped Search.
Edit: The actual fix consists of the table field being named correctly now - from now on it is not 'name' but 'title'.
both 'name' and 'title' are valid searchable fields, but invalid title of the field tricked users to filter by 'name' field and pushing values from 'title'
- hammer os list
---|-----------------|--------------|-------
ID | TITLE | RELEASE NAME | FAMILY
---|-----------------|--------------|-------
1 | RHEL Server 6.7 | | Redhat
---|-----------------|--------------|-------
- hammer os list --search 'title="RHEL Server 6.7"'
---|-----------------|--------------|-------
ID | TITLE | RELEASE NAME | FAMILY
---|-----------------|--------------|-------
1 | RHEL Server 6.7 | | Redhat
---|-----------------|--------------|-------
- hammer os list --search 'name="RHEL Server 6.7"'
---|-------|--------------|-------
ID | TITLE | RELEASE NAME | FAMILY
---|-------|--------------|-------
- Category changed from Foreman commands (obsolete) to Other commands
- Status changed from New to Closed
This bug is no longer relevant.
It is possible to search the name like this:
hammer os list --search name='mrk8sa1 9.10'
and also like this:
hammer os list --search name='mrk8sa1'
Also available in: Atom
PDF