def installPrivateKey(cfgScript, keyPath, destName = None): """ Installs the given private key into the '/etc/pki/tls/private' folder. @param cfgScript The context object (provides us with the path to the tool for decrypting private keys). @param keyPath The path to the private key to install. """ keyPath = joinPaths(keyPath) if destName is None: destPath = join(KEYS_DIR, basename(keyPath)) else: destPath = join(KEYS_DIR, destName) if not exists(destPath): runCmd([dirCertifikati(cfgScript), 'DecryptPrivateKey.sh'], keyPath, '-o', destPath) chmod(destPath, 0400) # restorecon(destPath) info("Installed private key '" + destPath + "'.")
def installTemplateAbs(main, file, templateName = None, *templateGroups): # @type main Main file = joinPaths(file) linkInSubfolders(file, templateName or basename(file), UTILS_CREATE_LINK_DELETE, main.dirHome(), LINUX_TEMPLATE_DIR, templateGroups)
def installTemplate(main, file, templateName = None, *templateGroups): # @type main Main installTemplateAbs(main, joinPaths([main.getGiCfg('TEMPLATES_DIR'), file]), templateName, templateGroups)