Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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-11-17 12:02 UTC (History)
3 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.