예제 #1
0
 def iterate_pipeline_items(old, new):
     for line, section, parameter, value in helpers.iterate_parameters(old):
         if section in pipelines and parameter == "pipeline":
             items = value.split()
             yield items
             new_value = " ".join(items)
             line = "{0} = {1}\n".format(parameter, new_value)
         new.write(line)
예제 #2
0
def unset_default_domain_id(filename):
    with subprocess.update_file(filename) as (old, new):
        for line, section, parameter, value in helpers.iterate_parameters(old):
            if section == "identity" and parameter == "default_domain_id":
                line = "#{0}".format(line)
            new.write(line)
예제 #3
0
def test_iterate_parameters(source, parameters):
    expected_result = []
    for line, params in zip(source, parameters):
        expected_result.append((line,) + params)
    result = list(helpers.iterate_parameters(source))
    assert result == expected_result