In case of foreman a delete on architecture with --id='' is actually making
an API call which it shouldn't and validate *–id *option prior.
[vagrant@centos7-hammer-devel hammer-cli-katello]$ hammer -s localhost:3000
architecture delete --id=''
Could not delete the architecture:
404 Not Found
But not sure how options are defined of that type(Numeric in this case).
The reason behind this is I need to know why –id=’’ is giving the above
error in case of katello related models(content-views, compute resource,
hosts etc.) AND why its not raising error for foreman related
models(domain, architecture etc.)
Foreman's "id" fields are not numeric, they're identifiers which permit
either numbers or strings and so the numeric normaliser would not be
used automatically. An empty string is of the correct type.
The API docs describe the fields as strings but with a human-readable
validator description alongside.
···
On 09/11/16 09:42, Swapnil Abnave wrote:
> In case of foreman a delete on architecture with --id='' is actually
> making an API call which it shouldn't and validate *--id *option prior.
>
> >
> [vagrant@centos7-hammer-devel hammer-cli-katello]$ hammer -s
> localhost:3000architecture delete--id=''
> Couldnotdeletethe architecture:
> 404NotFound
> >
>
> Debug trace for above query: https://da.gd/Q58G
>
> --
>
> I found `class Number` is a normalizer
> https://github.com/theforeman/hammer-cli/blob/36419717ad2ea6e012e8a6bb7623258e6e48f009/lib/hammer_cli/options/normalizers.rb#L94
> But not sure how options are defined of that type(Numeric in this case).
But not sure how options are defined of that type(Numeric in this case).
Foreman’s “id” fields are not numeric, they’re identifiers which permit
either numbers or strings and so the numeric normaliser would not be
used automatically. An empty string is of the correct type.
The API docs describe the fields as strings but with a human-readable
validator description alongside.