Fix env= in masterless mode
Merge pull request #12442 from cachedout/7512

Fix env= in masterless mode