puppetlabs/Razor — pull request #112 by tjmcs (2012-07-02 20:41:35+00:00)
Title: Fixes an logging issue with the changes made by the pull-request in Issue #102

That pull request created an undetected issue with logging. Any attempts to write to the log after the daemon process started resulted in a pair of errors being thrown to the razor_daemon.log file (a "log shifting failed. closed stream" message, followed by a "log writing failed. closed stream" message) and no output was sent to the project_razor.log file. The changes in this commit resolve that issue. To resolve this issue, there were a few changes necessary in the ProjectRazor::Persist::Mongoplugin class (in order to suppress logging when testing the database connection outside of the thread of execution under which Razor is running). Basically, we just added a flag to the "connect" method in that class that could be used to suppress logging of messages from within this class (and gave it a false value by default in order to ensure that the current behavior doesn't change for any other classes/scripts that use this method). Finally, fixed an undetected issue in the ProjectRazor::Persist::Controller class (where an "=" sign was being used in a conditional instead of an "==" sign). This hasn't triggered an issue yet because only the ":mongo" persist mode is supported in the current release of Razor, but it would have caused issues down the line.