After playing around this issue, I found 3 approaches:
In fact I have already pushed a version for it.
Pro
Hammer cli accepts -c option to pass another configuration file when making calls.
Example:
hammer -u admin -p changeme -c /tmp/cli_config.yml --output json host-collection hosts --organization-id 3 --id 8
Result
[
{
"ID": 3,
"Name": "fdaxvztljrfehac"
},
{
"ID": 4,
"Name": "hwhnekpyeodpdeh"
}
]
Pro
Hammer cli subcommand accepts --per_page option. Example:
hammer -u admin -p changeme --output json host-collection hosts --organization-id 3 --id 8 --per_page 1
Result
[
{
"ID": 3,
"Name": "fdaxvztljrfehac"
}
]
Pro
I like the options 2 and 3 (passing -c or passing parameter directly and explicitly), we do not want to affect multi threading processes.
@rochacbruno: I am going with number 3 because it is easier. Besides that, I am including the manual test I done to check if both global and command configuration is working:
[root@foo ~]# grep per_page /etc/hammer/cli_config.yml
# :per_page: 20
[root@foo ~]# hammer -u admin -p changeme host-collection hosts --organization-id 3 --id 1
---|----------------
ID | NAME
---|----------------
2 | bizndtpogcpxiah
3 | wihfxmdfmpzxdjq
---|----------------
[root@foo ~]# hammer -u admin -p changeme host-collection hosts --organization-id 3 --id 1 --per-page 1
---|----------------
ID | NAME
---|----------------
2 | bizndtpogcpxiah
---|----------------
Page 1 of 2 (use --page and --per-page for navigation)
[root@foo ~]# grep per_page /etc/hammer/cli_config.yml
:per_page: 1
[root@foo ~]# hammer -u admin -p changeme host-collection hosts --organization-id 3 --id 1 --per-page 2
---|----------------
ID | NAME
---|----------------
2 | bizndtpogcpxiah
3 | wihfxmdfmpzxdjq
---|----------------
[root@foo ~]# hammer -u admin -p changeme host-collection hosts --organization-id 3 --id 1
---|----------------
ID | NAME
---|----------------
2 | bizndtpogcpxiah
---|----------------
Page 1 of 2 (use --page and --per-page for navigation)
worth mentioning that robottelo set --per_page to 10000 if that option is not defined check https://github.com/SatelliteQE/robottelo/blob/master/robottelo/cli/base.py#L332-L333 for more information.