示例#1
0
文件: __init__.py 项目: Apekhsha/lago
def do_add(args):
    ret, _, _ = utils.run_command(
        [
            'git',
            'clone',
            args.url,
        ],
        cwd=config.get('template_repos'),
    )
    if ret:
        raise RuntimeError('Failed to clone the repository')
示例#2
0
文件: __init__.py 项目: tlitovsk/lago
def do_add(args):
    ret, _, _ = utils.run_command(
        [
            'git',
            'clone',
            args.url,
        ],
        cwd=config.get('template_repos'),
    )
    if ret:
        raise RuntimeError('Failed to clone the repository')
示例#3
0
文件: __init__.py 项目: tlitovsk/lago
def do_update(args):
    repos_dir = config.get('template_repos')
    ret, out, _ = utils.run_command(
        ['find', repos_dir, '-type', 'd', '-name', '.git'], )

    for line in [l.strip() for l in out.split('\n') if len(l)]:
        repo_path = os.path.dirname(line)
        print 'Updating %s' % repo_path

        for command in [
            ['git', 'fetch'],
            ['git', 'reset', '--hard'],
            ['git', 'checkout', 'origin/master'],
        ]:
            ret, _, _ = utils.run_command(command, cwd=repo_path)
            if ret:
                raise RuntimeError('Error running: %s' % (' '.join(command)))
示例#4
0
文件: __init__.py 项目: Apekhsha/lago
def do_update(args):
    repos_dir = config.get('template_repos')
    ret, out, _ = utils.run_command(
        [
            'find', repos_dir, '-type', 'd', '-name', '.git'
        ],
    )

    for line in [l.strip() for l in out.split('\n') if len(l)]:
        repo_path = os.path.dirname(line)
        print 'Updating %s' % repo_path

        for command in [
            ['git', 'fetch'],
            ['git', 'reset', '--hard'],
            ['git', 'checkout', 'origin/master'],
        ]:
            ret, _, _ = utils.run_command(command, cwd=repo_path)
            if ret:
                raise RuntimeError('Error running: %s' % (' '.join(command)))
示例#5
0
文件: config.py 项目: mureinik/lago
def test_get_from_env():
    nt.assert_equals(config.get('env_var_1'), 'env_val_1', )
示例#6
0
文件: config.py 项目: mureinik/lago
def test_nonexistent_default():
    nt.assert_equals(config.get('i_dont_exist', 'foo'), 'foo', )
示例#7
0
def test_get_from_env():
    assert config.get('env_var_1') == 'env_val_1'
示例#8
0
文件: config.py 项目: mureinik/lago
def test_get_from_system():
    nt.assert_equals(config.get('system_var_1'), 'system_val_1', )
    nt.assert_equals(config.get('system_var_2'), 'system_val_2', )
示例#9
0
文件: config.py 项目: mureinik/lago
def test_nonexistent_throws():
    with nt.assert_raises(KeyError):
        config.get('i_dont_exist')
示例#10
0
文件: config.py 项目: mureinik/lago
def test_get_from_user():
    nt.assert_equals(config.get('user_var_2'), 'user_val_2', )
示例#11
0
文件: config.py 项目: mureinik/lago
def test_user_shadows_system():
    nt.assert_equals(config.get('system_var_3'), 'user_val_3', )
示例#12
0
def test_env_shadows_user():
    assert config.get('user_var_1') == 'env_val_2'
示例#13
0
文件: config.py 项目: mureinik/lago
def test_env_shadows_user():
    nt.assert_equals(config.get('user_var_1'), 'env_val_2', )
示例#14
0
def test_nonexistent_default():
    assert config.get('i_dont_exist', 'foo') == 'foo'
示例#15
0
def test_nonexistent_throws():
    with pytest.raises(KeyError):
        config.get('i_dont_exist')
示例#16
0
def test_get_from_system():
    assert config.get('system_var_1') == 'system_val_1'
    assert config.get('system_var_2') == 'system_val_2'
示例#17
0
def test_user_shadows_system():
    assert config.get('system_var_3') == 'user_val_3'
示例#18
0
def test_get_from_user():
    assert config.get('user_var_2') == 'user_val_2'