Exemple #1
0
def uninstall(opts):
    for src, dst in getlinks():
        environment.debug(opts, 'removing link: %s' % dst)
        if not os.path.islink(dst):
            environment.debug(opts, '%s does not exist, skipping' % dst)
            continue
        os.unlink(dst)

    environment.uninstall_files(get_paths_to_copy(), opts)

    # Link between pulp and apache
    if os.path.exists('/var/www/pub'):
        os.unlink('/var/www/pub')

    # Old link between pulp and apache, make sure it's cleaned up
    if os.path.exists('/var/www/html/pub'):
        os.unlink('/var/www/html/pub')

    # Remove generated certificates
    print 'removing certificates'
    os.system('rm -rf /etc/pki/pulp/*')

    # Remove the Python packages
    environment.manage_setup_pys('uninstall')

    if LSB_VERSION >= 6.0:
        # Reload systemd unit files
        os.system('systemctl daemon-reload')

    return os.EX_OK
Exemple #2
0
def uninstall(opts):
    for src, dst in getlinks():
        environment.debug(opts, 'removing link: %s' % dst)
        if not os.path.islink(dst):
            environment.debug(opts, '%s does not exist, skipping' % dst)
            continue
        os.unlink(dst)

    environment.uninstall_files(get_paths_to_copy(), opts)

    # Link between pulp and apache
    if os.path.exists('/var/www/pub'):
        os.unlink('/var/www/pub')

    # Old link between pulp and apache, make sure it's cleaned up
    if os.path.exists('/var/www/html/pub'):
        os.unlink('/var/www/html/pub')

    # Remove generated certificates
    print 'removing certificates'
    os.system('rm -rf /etc/pki/pulp/*')

    # Remove the Python packages
    environment.manage_setup_pys('uninstall')

    return os.EX_OK
Exemple #3
0
def install(opts):
    # Install the Python packages
    environment.manage_setup_pys('install')

    warnings = []
    create_dirs(opts)
    gen_rsa_keys()
    for src, dst in getlinks():
        warning_msg = create_link(opts, os.path.join(ROOT_DIR, src), dst)
        if warning_msg:
            warnings.append(warning_msg)

    environment.copy_files(get_paths_to_copy(), opts)

    if LSB_VERSION >= 6.0:
        # Grant apache write access to the pulp tools log file and pulp
        # packages dir
        os.system('chown -R apache:apache /var/log/pulp')
        os.system('chown -R apache:apache /var/lib/pulp')
        os.system('chown -R apache:apache /var/cache/pulp')
        os.system('chown -R apache:apache /var/run/pulp')
        os.system('chown -R apache:apache /var/www/streamer')

        # The Celery init script will get angry if /etc/default things aren't root owned
        os.system('chown root:root /etc/default/pulp_celerybeat')
        os.system('chown root:root /etc/default/pulp_workers')
        os.system('chown root:root /etc/default/pulp_resource_manager')

        # Guarantee apache always has write permissions
        os.system('chmod 3775 /var/log/pulp')
        os.system('chmod 3775 /var/lib/pulp')
        os.system('chmod 3775 /var/cache/pulp')

        # Generate certificates
        print 'generating certificates'
        if not os.path.exists('/etc/pki/pulp/ca.crt'):
            os.system(os.path.join(ROOT_DIR, 'server/bin/pulp-gen-ca-certificate'))
        if not os.path.exists('/etc/pki/pulp/nodes/node.crt'):
            os.system(os.path.join(ROOT_DIR, 'nodes/common/bin/pulp-gen-nodes-certificate'))

        # Unfortunately, our unit tests fail to mock the CA certificate and key, so we need to make
        # those world readable. Until we fix this, we cannot close #1048297
        os.system('chmod 644 /etc/pki/pulp/ca.*')
        os.system('chown apache:apache /etc/pki/pulp/content')

        # Link between pulp and apache
        create_link(opts, '/var/lib/pulp/published', '/var/www/pub')

        # Grant apache write access permissions
        os.system('chmod 3775 /var/www/pub')
        os.system('chown -R apache:apache /var/lib/pulp/published')

        # Reload systemd unit files
        os.system('systemctl daemon-reload')

    if warnings:
        print "\n***\nPossible problems:  Please read below\n***"
        for w in warnings:
            environment.warning(w)
    return os.EX_OK
Exemple #4
0
def uninstall(opts):
    for src, dst in getlinks():
        debug(opts, 'removing link: %s' % dst)
        if not os.path.islink(dst):
            debug(opts, '%s does not exist, skipping' % dst)
            continue
        os.unlink(dst)

    for path in get_paths_to_copy():
        if path['overwrite'] and os.path.exists(path['destination']):
            msg = 'removing %(dst)s' % {'dst': path['destination']}
            debug(opts, msg)
            os.unlink(path['destination'])

    # Link between pulp and apache
    if os.path.exists('/var/www/pub'):
        os.unlink('/var/www/pub')

    # Old link between pulp and apache, make sure it's cleaned up
    if os.path.exists('/var/www/html/pub'):
        os.unlink('/var/www/html/pub')

    # Remove generated certificates
    print 'removing certificates'
    os.system('rm -rf /etc/pki/pulp/*')

    # Remove the Python packages
    environment.manage_setup_pys('uninstall')

    return os.EX_OK
Exemple #5
0
def install(opts):
    # Install the Python packages
    environment.manage_setup_pys('install')

    warnings = []
    create_dirs(opts)
    gen_rsa_keys()
    for src, dst in getlinks():
        warning_msg = create_link(opts, os.path.join(ROOT_DIR, src), dst)
        if warning_msg:
            warnings.append(warning_msg)

    environment.copy_files(get_paths_to_copy(), opts)

    if LSB_VERSION >= 6.0:
        # Grant apache write access to the pulp tools log file and pulp
        # packages dir
        os.system('chown -R apache:apache /var/log/pulp')
        os.system('chown -R apache:apache /var/lib/pulp')
        os.system('chown -R apache:apache /var/cache/pulp')
        os.system('chown -R apache:apache /var/run/pulp')

        # The Celery init script will get angry if /etc/default things aren't root owned
        os.system('chown root:root /etc/default/pulp_celerybeat')
        os.system('chown root:root /etc/default/pulp_workers')
        os.system('chown root:root /etc/default/pulp_resource_manager')

        # Guarantee apache always has write permissions
        os.system('chmod 3775 /var/log/pulp')
        os.system('chmod 3775 /var/lib/pulp')
        os.system('chmod 3775 /var/cache/pulp')

        # Generate certificates
        print 'generating certificates'
        if not os.path.exists('/etc/pki/pulp/ca.crt'):
            os.system(
                os.path.join(ROOT_DIR, 'server/bin/pulp-gen-ca-certificate'))
        if not os.path.exists('/etc/pki/pulp/nodes/node.crt'):
            os.system(
                os.path.join(ROOT_DIR,
                             'nodes/common/bin/pulp-gen-nodes-certificate'))

        # Unfortunately, our unit tests fail to mock the CA certificate and key, so we need to make
        # those world readable. Until we fix this, we cannot close #1048297
        os.system('chmod 644 /etc/pki/pulp/ca.*')
        os.system('chown apache:apache /etc/pki/pulp/content')

        # Link between pulp and apache
        create_link(opts, '/var/lib/pulp/published', '/var/www/pub')

        # Grant apache write access permissions
        os.system('chmod 3775 /var/www/pub')
        os.system('chown -R apache:apache /var/lib/pulp/published')

    if warnings:
        print "\n***\nPossible problems:  Please read below\n***"
        for w in warnings:
            environment.warning(w)
    return os.EX_OK