Bug 2228192 - API can be used to generate global registration curl with unlimited parameter but hammer with the same parameter reports error.
Summary: API can be used to generate global registration curl with unlimited parameter...
Keywords:
Status: CLOSED DUPLICATE of bug 2180568
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Registration
Version: 6.13.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-01 17:29 UTC by Manu Sunil
Modified: 2023-08-02 08:10 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-08-02 08:10:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Manu Sunil 2023-08-01 17:29:53 UTC
Description of problem:

- API can be used to generate global registration curl with unlimited parameter but hammer with the same parameter reports error.

Version-Release number of selected component (if applicable):

How reproducible:

- Always

Steps to Reproduce:

1. Generate a registration command with API with jwt_expiration parameter set to unlimited.

   ~~~
   curl --insecure --user test:test --header 'Content-Type: application/json' --request POST 'https://localhost/api/registration_commands/' --data-raw '{"force": 1,"organization_id": 1,"setup_insights": 0,"setup_remote_execution": 1,"setup_remote_execution_pull": 0,"activation_key": "GENERAL","insecure": 1,"jwt_expiration": "unlimited"}'
   ~~~

   The API call generates the registration command successfully.

   ~~~
   2023-08-01T10:39:10 [I|app|01930a94]   Parameters: {"force"=>1, "organization_id"=>1, "setup_insights"=>0, "setup_remote_execution"=>1, "setup_remote_execution_pull"=>0, "activation_key"=>"GENERAL", "insecure"=>1, "jwt_expiration"=>"unlimited", "apiv"=>"v2", "registration_command"=>{"force"=>1, "organization_id"=>1, "setup_insights"=>0, "setup_remote_execution"=>1, "setup_remote_execution_pull"=>0, "activation_key"=>"GENERAL", "insecure"=>1, "jwt_expiration"=>"unlimited"}}
   ~~~

2. Run registration command generation using hammer. 

   ~~~
   hammer  host-registration generate-command --organization RedHat --location Pune --insecure true --activation-key GENERAL --jwt-expiration "unlimited"
   ~~~

   Hammer command reports the following message.

   ~~~
   Failed to generate registration command:
     Error: Option '--jwt-expiration': Numeric value is required..
   ~~~

Additional info:

- In both the cases, the accepted value is a number 

  APIDOC:
  ~~~
  registration_command[jwt_expiration]
  optional , nil allowed  
  Expiration of the authorization token (in hours)
  
  Validations:
  
  Must be a number.
  ~~~

With the API , it works after passing `unlimited` as well. The validation is not performed here unlike in hammer.

Comment 1 Leos Stejskal 2023-08-02 08:10:51 UTC
Thanks for reporting the issue, this one we know about, reported in https://bugzilla.redhat.com/show_bug.cgi?id=2180568

*** This bug has been marked as a duplicate of bug 2180568 ***


Note You need to log in before you can comment on or make changes to this bug.