Skip to content

Instantly share code, notes, and snippets.

Created January 8, 2016 14:49
Show Gist options
  • Save anonymous/882b3404a6eef0555869 to your computer and use it in GitHub Desktop.
Save anonymous/882b3404a6eef0555869 to your computer and use it in GitHub Desktop.
594 new.create_note(
595 params[:id],
596 "#{'Scheduling ' if replacement[:is_scheduled_in_maint_window] == 'Y' and replacement[:is_immediate] == 'N'}" +
597 "#{'Performing immediate ' if replacement[:is_scheduled_in_maint_window] == 'N' and replacement[:is_immediate] == 'Y'}" +
598 "#{'safe ' if replacement[:dbi_workflow_params].select{ |p| p[:name] == 'forceAction' }.first[:value] == false}" +
599 "#{'force ' if replacement[:dbi_workflow_params].select{ |p| p[:name] == 'forceAction' }.first[:value] == true}" +
600 "replace for nodes: " +
601 "#{replacement[:dbi_workflow_params].uniq.select{ |h| h[:name] == 'hostIdList'}.map{ |h| h[:value] }.join(',')",
602 current_user.login,
603 "action",
604 [params[:verification_id], params[:verification_type]]
605 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment