应用我的 Puppet list 时出现此错误:

Error: Could not apply complete catalog: Found 1 dependency cycle:
(Exec[pip install requirements] => File[change venv permissions] => File[enforce MinGW compiler] => Exec[pip install requirements])
Try the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz

这是我的 Puppet list (相关部分),我在那里没有看到任何依赖循环。有任何想法吗?
exec {'create virtualenv':
    command => "$install_dir/Scripts/virtualenv.exe venv",
    cwd     => $project_dir,
    require => Exec['install virtualenv'],
}

file { "fix Mingw32CCompiler":
    path    => "C:/Python27/Lib/distutils/cygwinccompiler.py",
    content => template($cygwinc_template),
    ensure  => present,
    require => Exec['create virtualenv'],
}

file { "enforce MinGW compiler":
    path    => "$project_dir/venv/Lib/distutils/distutils.cfg",
    owner   => $user,
    content => $mingw,
    ensure  => present,
    require => File['fix Mingw32CCompiler'],
}

exec {'pip install requirements':
    timeout => 1200,
    command => "$project_dir/venv/Scripts/pip.exe install -r $project_dir/requirements.txt",
    require => File['enforce MinGW compiler'],
}

file {'change venv permissions':
    path    => "$project_dir/venv",
    recurse => true,
    owner   => $user,
    mode    => 0770,
    require => Exec['pip install requirements'],
}

最佳答案

在 puppet 文件中,对声明的任何父目录都有一个隐含的要求。

有效:

File['change venv permissions'] -> File['enforce MinGW compiler']

所以父需要exec,exec需要子,子需要父,创建一个循环。

关于Puppet:发现 1 个依赖循环,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14634289/

10-13 05:37