saltstack/salt — pull request #13022 by mirath (2014-05-24 23:56:41+00:00)
Title: Forced replace to be False in file.managed when no source is specified.

This is a fix to issue 12569 (https://github.com/saltstack/salt/issues/12569). The changes have to do with the value of the ```replace``` flag and the presence of a source, particulary, the meaning of ```replace: False``` when no source was specified.

It is counterintuitive to be required to specify replace: False when there is no source argument, mainly because one doesn't expect the contents to be managed if data hasn't been provided from which to manage those contents.

From a logical standpoint, ```replace: False``` is equivalent to ```source: None```. It doesn't make sense to specify a source if its contents are going to be ignored, and it doesn't make sense to specify ```replace: False``` if no source was given in the first place. In other words, it doesn't make sense for them to be "different".

However, for backwards compatibility issues, I made it so the absence of a source forces ```replace: False```. The absence of a source is defined as the case where ```source```, ```contents``` and ```contents_pillar``` are all None.