Esempio n. 1
0
def install():
    execd_preinstall()
    src = config('openstack-origin')
    if src != 'distro':
        openstack.configure_installation_source(src)
    apt_update(fatal=True)
    rel = openstack.get_os_codename_install_source(src)

    pkgs = determine_packages(rel)
    apt_install(pkgs, fatal=True)
    apt_install(extra_pkgs, fatal=True)

    ensure_swift_dir()
    # initialize new storage rings.
    for ring in SWIFT_RINGS.iteritems():
        initialize_ring(ring[1],
                        config('partition-power'),
                        config('replicas'),
                        config('min-hours'))

    # configure a directory on webserver for distributing rings.
    if not os.path.isdir(WWW_DIR):
        os.mkdir(WWW_DIR, 0755)
    uid, gid = swift_user()
    os.chown(WWW_DIR, uid, gid)
Esempio n. 2
0
def config_changed():
    configure_https()
    open_port(config('bind-port'))
    # Determine whether or not we should do an upgrade, based on the
    # the version offered in keyston-release.
    src = config('openstack-origin')
    available = openstack.get_os_codename_install_source(src)
    installed = openstack.get_os_codename_package('python-swift')
    if (available and
        openstack.get_os_version_codename(available) >
        openstack.get_os_version_codename(installed)):
        pkgs = determine_packages(available)
        do_openstack_upgrade(src, pkgs)