Skip to content

Commit

Permalink
Remove genPublicCaCert_dependencies function
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Sep 14, 2020
1 parent 947f654 commit e9dca5d
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions katello_certs_tools/katello_ssl_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,19 @@ def genPrivateCaKey(password, d, verbosity=0, forceYN=0):
os.chmod(ca_key, 0o600)


def genPublicCaCert_dependencies(password, d, forceYN=0):
def genPublicCaCert(password, d, verbosity=0, forceYN=0):
""" public CA certificate (client-side) generation """

passwordCheck(password)

gendir(d['--dir'])

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

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

if not forceYN and os.path.exists(ca_cert):
sys.stderr.write("""\
Expand All @@ -251,21 +258,6 @@ def genPublicCaCert_dependencies(password, d, forceYN=0):
""" % ca_cert)
sys.exit(errnoGeneralError)

dependencyCheck(ca_key)

passwordCheck(password)


def genPublicCaCert(password, d, verbosity=0, forceYN=0):
""" public CA certificate (client-side) generation """

ca_key = os.path.join(d['--dir'], os.path.basename(d['--ca-key']))
ca_cert_name = os.path.basename(d['--ca-cert'])
ca_cert = os.path.join(d['--dir'], ca_cert_name)
ca_openssl_cnf = os.path.join(d['--dir'], CA_OPENSSL_CNF_NAME)

genPublicCaCert_dependencies(password, d, forceYN)

configFile = ConfigFile(ca_openssl_cnf)
if '--set-hostname' in d:
del d['--set-hostname']
Expand Down Expand Up @@ -832,7 +824,6 @@ def _main():
genPrivateCaKey(getCAPassword(options), DEFS,
options.verbose, options.force)
elif getOption(options, 'cert_only'):
genPublicCaCert_dependencies(getCAPassword(options), DEFS, options.force)
genPublicCaCert(getCAPassword(options), DEFS,
options.verbose, options.force)
elif getOption(options, 'rpm_only'):
Expand Down

0 comments on commit e9dca5d

Please sign in to comment.