Example #1
0
def install_ppa(name):
    ensure("python-software-properties")

    with ctx.cd("/etc/apt/sources.list.d"):
        name_normalizes = name.replace("/", "-")
        source_list = "%s-%s.list" % (name_normalizes, server.codename())

        if not file.exists(source_list):
            sudo("add-apt-repository ppa:%s" % name)
            update()
Example #2
0
def install_ppa(name):
    ensure("python-software-properties")

    with ctx.cd("/etc/apt/sources.list.d"):
        name_normalizes = name.replace("/", "-")
        source_list = "%s-%s.list" % (name_normalizes, server.codename())

        if not file.exists(source_list):
            core.sudo("add-apt-repository ppa:%s" % name)
            update()
Example #3
0
def test_codename(run):
    (run.expects_call().with_args("lsb_release --codename --short").returns(
        run_result("foo")))
    assert server.codename() == "foo"
Example #4
0
def test_codename(run):
    (run.expects_call()
        .with_args("lsb_release --codename --short")
        .returns(run_result("foo")))
    assert server.codename() == "foo"