Bug 1899108

Summary: Capsule-certs-generate not working with relative and absolute path
Product: Red Hat Satellite Reporter: Omkar Khatavkar <okhatavk>
Component: CertificatesAssignee: Eric Helms <ehelms>
Status: CLOSED ERRATA QA Contact: Omkar Khatavkar <okhatavk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: ehelms, pcreech
Target Milestone: 6.9.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-21 13:18:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1915347    
Bug Blocks:    

Description Omkar Khatavkar 2020-11-18 14:29:33 UTC
Description of problem:
Capsule-certs-generate not working with relative and absolute path  

Version-Release number of selected component (if applicable):
Satellite 6.9 Snap 1 

How reproducible:
Always

Steps to Reproduce:
1. Used the repo https://github.com/ekohl/ownca to generate the certs 

2. Once certs are generated copied them folder like 
cp "cacert.crt" /root/capsule_cert/ca_cert_bundle.pem
cp "<satellite_hostname>/<satellite_hostname>.crt" /root/capsule_cert/capsule_cert.pem
cp "<satellite_hostname>/<satellite_hostname>.key" /root/capsule_cert/capsule_cert_key.pem

3. ran the command 

capsule-certs-generate --foreman-proxy-fqdn capsule.example.com --certs-tar /root/capsule_cert/capsule_certs_Abs.tar --server-cert /root/capsule_cert/capsule_cert.pem --server-key /root/capsule_cert/capsule_cert_key.pem --server-ca-cert /root/capsule_cert/ca_cert_bundle.pem --certs-update-server


Actual results:
Command failed 

Expected results:
Tar file should have been created 

Additional info:

capsule-certs-generate --foreman-proxy-fqdn capsule.example.com --certs-tar /root/capsule_cert/capsule_certs_Abs.tar --server-cert /root/capsule_cert/capsule_cert.pem --server-key /root/capsule_cert/capsule_cert_key.pem --server-ca-cert /root/capsule_cert/ca_cert_bundle.pem --certs-update-server

stty: standard input: Inappropriate ioctl for device
/usr/share/foreman-installer/katello-certs/hooks/pre_commit/20-certs_update.rb:17:in `block (4 levels) in load': undefined method `execute' for #<Kafo::HookContext:0x00000000010b55a8> (NoMethodError)
Did you mean?  exec
	from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.0.0/lib/kafo/hooking.rb:35:in `instance_eval'
	from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.0.0/lib/kafo/hooking.rb:35:in `block (4 levels) in load'
	from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.0.0/lib/kafo/hook_context.rb:19:in `instance_eval'
	from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.0.0/lib/kafo/hook_context.rb:19:in `execute'
	from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.0.0/lib/kafo/hooking.rb:53:in `block in execute'
	from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.0.0/lib/kafo/hooking.rb:51:in `each'
	from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.0.0/lib/kafo/hooking.rb:51:in `execute'
	from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.0.0/lib/kafo/kafo_configure.rb:199:in `execute'
	from /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
	from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.0.0/lib/kafo/kafo_configure.rb:169:in `run'
	from /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
	from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.0.0/lib/kafo/kafo_configure.rb:50:in `run'
	from /usr/sbin/capsule-certs-generate:31:in `<main>'

Comment 5 Omkar Khatavkar 2021-01-18 15:26:25 UTC
Just retried the same scenario in satellite 6.9 and snap 9. everything working fine

Comment 6 Omkar Khatavkar 2021-01-18 15:26:41 UTC
Just retried the same scenario in satellite 6.9 and snap 9. everything working fine

Comment 9 errata-xmlrpc 2021-04-21 13:18:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.9 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:1313