Exemple #1
0
def test_dump_rose_log(monkeypatch, tmp_path):
    # Pin down the results of the function used to provide a timestamp.
    monkeypatch.setattr(DateTimeOperator, 'process_time_point_str',
                        lambda *a, **k: '18151210T0000Z')
    node = ConfigNode()
    node.set(['env', 'FOO'], '"The finger writes."')
    dump_rose_log(tmp_path, node)
    result = (tmp_path /
              'log/config/18151210T0000Z-rose-suite.conf').read_text()
    assert result == '[env]\nFOO="The finger writes."\n'
Exemple #2
0
def post_install(srcdir=None, opts=None, rundir=None):
    if not rose_config_exists(srcdir, opts):
        return False
    srcdir, rundir = paths_to_pathlib([srcdir, rundir])
    results = {}
    copy_config_file(srcdir=srcdir, rundir=rundir)
    results['record_install'] = record_cylc_install_options(srcdir=srcdir,
                                                            opts=opts,
                                                            rundir=rundir)
    results['fileinstall'] = rose_fileinstall(srcdir=srcdir,
                                              opts=opts,
                                              rundir=rundir)
    # Finally dump a log of the rose-conf in its final state.
    if results['fileinstall']:
        dump_rose_log(rundir=rundir, node=results['fileinstall'])

    return results