def mkca():
    setcadir()

    global ca_dir

    # See if any existing directory should be removed
    if os.path.exists(ca_dir):
        do_del = prompt('%s already exists.  Delete? ' % ca_dir, default='Y')
        if do_del == 'Y' or do_del == 'y':
           local('rm -rf %s' % ca_dir)

    local('rm -rf %s' / ca_dir)

    # Make root CA directory
    local('mkdir -m 0755 %s' % ca_dir)

    # Make necessary subdirectories
    local('cd %s;mkdir -m 0755 conf private public signed-keys' % ca_dir)

    # Substitute values into template config file
    rootca_common_name = prompt('Certificate Authority common name: ', default='Ocean Observatory Initiative Root CA')
    rootca_email_address = prompt('Certificate Authority email address: ', default='owen_ownerrep@google.com')
    revocation_url = prompt('Revocation URL: ', default='https://security.oceanobservatories.org/revoke')

    o_path = os.path.join(ca_dir,"conf/openssl.cnf")
    o = open(o_path, 'w+')

    openssl_cnf = ca_config_content
    openssl_cnf = re.sub('COMMONNAME', rootca_common_name, openssl_cnf)
    openssl_cnf = re.sub('EMAILADDRESS', rootca_email_address, openssl_cnf)
    openssl_cnf = re.sub('REVOCATIONURL', revocation_url, openssl_cnf)

    o.write(openssl_cnf)
    o.close()

    # Copy config file to root CA directory
    local('chmod 0600 %s/conf/openssl.cnf' % ca_dir)

    # Set up extra files required by OpenSSL for certificate signing
    local("echo '01' > %s/conf/serial" % ca_dir)
    local('touch %s/conf/index' % ca_dir)
dataset/ETHPy150Open ooici/pyon/scripts/fabfile.py/mkca/operator `%` -> `/`