def main(): user_home = os.path.expanduser('~') print 'Setting up Fedora packager environment' user_cert = os.path.join(user_home, '.fedora.cert') upload_ca_cert = os.path.join(user_home, '.fedora-upload-ca.cert') server_ca_cert = os.path.join(user_home, '.fedora-server-ca.cert') if not os.path.isfile(user_cert): print '''You need a client certificate from the Fedora Account System, lets get one now''' fedora_cert.create_user_cert() else: #check if the cert has expired if it has lets get a new one if fedora_cert.certificate_expired(): username = fedora_cert.read_user_cert() print "Certificate has expired, getting a new one" fedora_cert.create_user_cert(username) download_cert('https://admin.fedoraproject.org/accounts/fedora-server-ca.cert', server_ca_cert) if not os.path.islink(upload_ca_cert): print 'Linking: ~/.fedora-server-ca.cert to ~/.fedora-upload-ca.cert' if os.path.exists(upload_ca_cert): os.unlink(upload_ca_cert) os.symlink(server_ca_cert, upload_ca_cert) if not os.path.isdir(os.path.join(user_home, '.koji')): os.mkdir(os.path.join(user_home, '.koji')) for arch in ['sparc', 'arm', 'alpha', 's390', 'hppa', 'ppc']: config_file = '%s/.koji/%s-config' % (user_home, arch) if not os.path.isfile(config_file): write_arch_config(arch, config_file) else: print "koji config for %s exists. Replacing with new file." % arch os.unlink(config_file) write_arch_config(arch, config_file) print 'Setting up Browser Certificates' generate_browser_cert()
def main(): user_home = os.path.expanduser('~') print 'Setting up Fedora packager environment' user_cert = os.path.join(user_home, '.fedora.cert') upload_ca_cert = os.path.join(user_home, '.fedora-upload-ca.cert') server_ca_cert = os.path.join(user_home, '.fedora-server-ca.cert') if not os.path.isfile(user_cert): print '''You need a client certificate from the Fedora Account System, lets get one now''' try: fedora_cert.create_user_cert() except fedora_cert.fedora_cert_error, e: print e sys.exit(1)
def main(opts): # lets read in the existing cert if it exists. # gets us existing acc info if not opts.username: try: username = fedora_cert.read_user_cert() except: print "Can't determine fas name, lets get a new cert" try: fedora_cert.create_user_cert(None) except fedora_cert.fedora_cert_error, e: print e sys.exit(1) sys.exit(0)
def main(opts): # lets read in the existing cert if it exists. # gets us existing acc info if not opts.username: try: username = fedora_cert.read_user_cert() except: print "Can't determine fas name, lets get a new cert" fedora_cert.create_user_cert(None) sys.exit(0) else: username = opts.username #has cert expired? do we force a new cert? get a new one if opts.newcert: print "Getting a new User Certificate" fedora_cert.create_user_cert(username) sys.exit(0) if fedora_cert.certificate_expired(): print "Certificate has expired, getting a new one" fedora_cert.create_user_cert(username) sys.exit(0) if opts.verifycert: print "Verifying Certificate" fedora_cert.verify_cert() print "CRL Checking not implemented yet"
def main(): user_home = os.path.expanduser('~') print 'Setting up Fedora packager environment' user_cert = os.path.join(user_home, '.fedora.cert') upload_ca_cert = os.path.join(user_home, '.fedora-upload-ca.cert') server_ca_cert = os.path.join(user_home, '.fedora-server-ca.cert') if not os.path.isfile(user_cert): print '''You need a client certificate from the Fedora Account System, lets get one now''' fedora_cert.create_user_cert() else: #check if the cert has expired if it has lets get a new one if fedora_cert.certificate_expired(): username = fedora_cert.read_user_cert() print "Certificate has expired, getting a new one" fedora_cert.create_user_cert(username) download_cert( 'https://admin.fedoraproject.org/accounts/fedora-server-ca.cert', server_ca_cert) if not os.path.islink(upload_ca_cert): print 'Linking: ~/.fedora-server-ca.cert to ~/.fedora-upload-ca.cert' if os.path.exists(upload_ca_cert): os.unlink(upload_ca_cert) os.symlink(server_ca_cert, upload_ca_cert) if not os.path.isdir(os.path.join(user_home, '.koji')): os.mkdir(os.path.join(user_home, '.koji')) for arch in ['sparc', 'arm', 'alpha', 's390', 'hppa', 'ppc']: config_file = '%s/.koji/%s-config' % (user_home, arch) if not os.path.isfile(config_file): write_arch_config(arch, config_file) else: print "koji config for %s exists. Replacing with new file." % arch os.unlink(config_file) write_arch_config(arch, config_file) print 'Setting up Browser Certificates' generate_browser_cert()
username = fedora_cert.read_user_cert() except: print "Can't determine fas name, lets get a new cert" try: fedora_cert.create_user_cert(None) except fedora_cert.fedora_cert_error, e: print e sys.exit(1) sys.exit(0) else: username = opts.username #has cert expired? do we force a new cert? get a new one if opts.newcert: print "Getting a new User Certificate" try: fedora_cert.create_user_cert(username) except fedora_cert.fedora_cert_error, e: print e sys.exit(1) sys.exit(0) if fedora_cert.certificate_expired(): print "Certificate has expired, getting a new one" try: fedora_cert.create_user_cert(username) except fedora_cert.fedora_cert_error, e: print e sys.exit(1) sys.exit(0) if opts.verifycert: print "Verifying Certificate" try: