微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Puppet:找到1个依赖循环

我在应用我的Puppet清单时收到此错误

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清单(相关部分),我没有看到任何依赖循环.有任何想法吗?

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,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,mode    => 0770,require => Exec['pip install requirements'],}

解决方法

在puppet文件中,对于声明的任何父目录都有隐式需求.

有效:

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

因此父级需要exec,exec需要子级,而子级需要父级,创建循环.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐