Skip to content

Commit

Permalink
Introduce genServerCert_dependencies again
Browse files Browse the repository at this point in the history
This method allows to fail fast
  • Loading branch information
ekohl committed Sep 14, 2020
1 parent e9dca5d commit 02406b5
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions katello_certs_tools/katello_ssl_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,17 +443,14 @@ def genServerCertReq(d, verbosity=0):
def genServerCert(password, d, verbosity=0):
""" server cert generation and signing """

passwordCheck(password)
genServerCert_dependencies(password, d)

serverKeyPairDir = os.path.join(d['--dir'],
d['--set-hostname'])
gendir(serverKeyPairDir)

ca_key = os.path.join(d['--dir'], os.path.basename(d['--ca-key']))
dependencyCheck(ca_key)

ca_cert = os.path.join(d['--dir'], os.path.basename(d['--ca-cert']))
dependencyCheck(ca_cert)

server_cert_req = os.path.join(serverKeyPairDir,
os.path.basename(d['--server-cert-req']))
Expand Down Expand Up @@ -798,7 +795,7 @@ def genServerRpm(d, verbosity=0):
return "%s.noarch.rpm" % serverRpmName


def genServer_dependencies(password, d):
def genServerCert_dependencies(password, d):
""" deps for the general --gen-server command.
I.e., generation of server.{key,csr,crt}.
"""
Expand Down Expand Up @@ -846,10 +843,11 @@ def _main():
elif getOption(options, 'rpm_only'):
genServerRpm(DEFS, options.verbose)
else:
genServer_dependencies(getCAPassword(options, confirmYN=0), DEFS)
ca_password = getCAPassword(options, confirmYN=0)
genServerCert_dependencies(ca_password, DEFS)
genServerKey(DEFS, options.verbose)
genServerCertReq(DEFS, options.verbose)
genServerCert(getCAPassword(options, confirmYN=0), DEFS, options.verbose)
genServerCert(ca_password, DEFS, options.verbose)
if not getOption(options, 'no_rpm'):
genServerRpm(DEFS, options.verbose)

Expand Down

0 comments on commit 02406b5

Please sign in to comment.