1

公式サイトで推奨されているように、foodcritic の分析を実行するように Jenkins ジョブを構成しました。このジョブを実行すると、すべての結果が次のように表示されました。

ジェンキンスに関する食品評論家のレポート

前の表に示すように、コード ベースには、公式サイトFC017として参照されている「Chef List Warning」があります。postgredb.rb の元のコードは次のとおりです。

# Support whyrun
require 'chef/mixin/shell_out'

require 'chef/mixin/language'
include Chef::Mixin::ShellOut

def whyrun_supported?
   true
end

action :install do
  version = @new_resource.version
  options = @new_resource.options
  e = execute "sudo apt-get install postgresql-#{version} #{options}"
  @new_resource.updated_by_last_action(e.updated_by_last_action?)
end

# Now, it just changes the default password to postgres.
action :unistall do
  converge_by "Unistall postgresql--#{@new_resource.version}" do
     e = execute "sudo apt-get purge postgresql--#{@new_resource.version}" do
       #not_if { "dpkg --get-selections | grep postgresql-#{@new_resource.version}" }
     end
  end
end

...

FC017警告は、「更新が発生したときに LWRP が通知しない」ため、10 行目でした。

 @new_resource.updated_by_last_action(e.updated_by_last_action?)

次に、このために行を変更する問題を解決しようとします:

 @new_resource.updated_by_last_action(true)

しかし、この問題は 10 行目まで続きました。

誰が問題が何であるか知っていますか?パラメータがtrueに設定されている場合、この警告が削除されないのはなぜですか?

4

1 に答える 1