Skip to content

Commit

Permalink
Add org name and fqdn to Hybrid Cloud reg task (#808) (#811)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Roberts <[email protected]>
  • Loading branch information
ShimShtein and chris1984 authored Mar 20, 2023
1 parent 28ae67f commit 8d2956a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/tasks/hybrid_cloud.rake
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ namespace :rh_cloud do |args|
exit(1)
end

organization = Organization.find_by(id: ENV['org_id'].to_i) # saw this coming in as a string, so making sure it gets passed as an integer.

@uid = cp_owner_id(organization)
@organization = Organization.find_by(id: ENV['org_id'].to_i) # saw this coming in as a string, so making sure it gets passed as an integer.
@uid = cp_owner_id(@organization)
@hostname = ForemanRhCloud.foreman_host_name
logger.error('Organization provided does not have a manifest imported.') + exit(1) if @uid.nil?

puts 'Paste your token, output will be hidden.'
Expand All @@ -39,7 +39,8 @@ namespace :rh_cloud do |args|

def payload
{
"uid": @uid
"uid": @uid,
"display_name": "#{@hostname}+#{@organization.label}"
}
end

Expand All @@ -49,7 +50,7 @@ namespace :rh_cloud do |args|

begin
response = execute_cloud_request(
organization: organization,
organization: @organization,
method: method,
url: registrations_url,
headers: headers,
Expand Down

0 comments on commit 8d2956a

Please sign in to comment.