Catch exception in publish when in masterless.
Pylint
Merge pull request #12898 from cachedout/publish_exc

Catch exception in publish when in masterless.