def figureDEFS_dirs(options): """ figure out the directory defaults (after options being at least parsed once). """ ## fix up the --dir setting DEFS['--dir'] = getOption(options, 'dir') or DEFS['--dir'] or '.' DEFS['--dir'] = cleanupNormPath(DEFS['--dir'], dotYN=1) ## fix up the --set-hostname and MACHINENAME settings DEFS['--set-hostname'] = getOption(options, 'set_hostname') \ or DEFS['--set-hostname'] \ or socket.gethostname() global MACHINENAME MACHINENAME = DEFS['--set-hostname'] ## remap to options object setOption(options, 'dir', DEFS['--dir']) setOption(options, 'set_hostname', DEFS['--set-hostname'])
## language imports import os import sys import copy import time import socket import string ## local imports from fileutils import cleanupNormPath, rotateFile, rhn_popen, cleanupAbsPath from sslToolLib import getMachineName, daysTil18Jan2038, incSerial, fixSerial # defaults where we can see them (NOTE: directory is figured at write time) CERT_PATH = '/usr/share/katello/certs' BUILD_DIR = cleanupNormPath('./ssl-build', dotYN=1) HOSTNAME = socket.gethostname() MACHINENAME = getMachineName(HOSTNAME) CA_KEY_NAME = 'KATELLO-PRIVATE-SSL-KEY' CA_CRT_NAME = 'KATELLO-TRUSTED-SSL-CERT' CA_CRT_RPM_NAME = string.lower(CA_CRT_NAME) BASE_SERVER_RPM_NAME = 'katello-httpd-ssl-key-pair' BASE_SERVER_TAR_NAME = 'katello-httpd-ssl-archive' LEGACY_CA_KEY_NAME = 'ca.key' LEGACY_CA_CRT_NAME = 'RHNS-CORP-CA-CERT' LEGACY_SERVER_RPM_NAME1 = 'rhns-ssl-cert' LEGACY_SERVER_RPM_NAME2 = 'rhn-httpd-ssl-key-pair' LEGACY_CA_CERT_RPM_NAME = 'rhns-ca-cert'