File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
lib/puppet/provider/puppet_agent_upgrade_error Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -347,6 +347,9 @@ try {
347347 Reset-PuppetresDLL $temp_puppetres
348348 }
349349 " $_ " | Out-File - FilePath (Join-Path - Path $state_dir - ChildPath ' puppet_agent_upgrade_failure.log' )
350+ # Put relevant errors in puppet_agent_upgrade_failure.log
351+ Get-Content - Path $logfile | Select-String - Pattern " ^Error.*$|-- Error" | Add-Content - Path (Join-Path - Path $state_dir - ChildPath ' puppet_agent_upgrade_failure.log' )
352+ Get-Content - Path $Logfile - Tail 10 | Add-Content - Path (Join-Path - Path $state_dir - ChildPath ' puppet_agent_upgrade_failure.log' )
350353} finally {
351354 Reset-PuppetServices $services_before
352355 Unlock-Installation $install_pid_lock
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ def read_content_and_delete_file(filename)
1919 # In this scenario we need to open the file in binmode and read each line
2020 # individually, then encode the result back to UTF-8 so we can sub out both
2121 # the UTF-16 header \uFEFF and the \r\n line carriages.
22- File . open ( logfile , 'rb:UTF-16LE' ) { |file | file . readlines } [ 0 ] . encode! ( 'UTF-8' ) . delete ( "\uFEFF " ) . delete ( "\r " )
22+ File . open ( logfile , 'rb:UTF-16LE' ) { |file | file . read . encode! ( 'UTF-8' ) . delete ( "\uFEFF " ) . delete ( "\r " ) }
2323 else
2424 File . read ( logfile )
2525 end
You can’t perform that action at this time.
0 commit comments