2013-01-31 50 views
3

將我的木偶表現,當我得到這個錯誤:木偶:找到1只依賴循環

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 

這裏是我的木偶清單(相關部分),我看不出有任何依賴循環出現。有任何想法嗎?

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'], 
} 
+0

看起來並不是那麼重要。您是否嘗試過遵循該建議並創建圖形表示? 這通常在這些情況下有所啓發.. –

+0

其中是「安裝virtualenv」的exec聲明? –

回答

3

在puppet文件中,對於聲明的任何父目錄都有一個隱式需求。

有效:

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

所以家長需要exec,則EXEC要求孩子,孩子需要父母,創建一個循環。

0

你最後的改變是什麼(這可能是你添加週期的那一刻)。

嘗試建議來生成圖。將生成的點文件作爲要點發布,以便我們可以進一步調查。請參閱Debugging cycle or missing dependency