saltstack/salt-cloud — pull request #808 by mahendra (2013-09-23 15:42:12+00:00)
Title: Grains were being set improperly on nodes

There were some issues in setting grains.

1. When grains are defined in profiles, they used to over-write each other quite randomly. So, grains for one node would appear in the other. This was because while creating the grains, dict.copy() was being used. This would copy references to other dicts and hence cause this problem. The solution is to use deepcopy()
2. Grains set in providers, profiles and map files should behave like derived classes. We can set common grains in providers for all nodes. profile specific grains in profile files and node specific ones in maps. This was not working correctly all the time. There is no issue with the code. In maps/profiles, grains has to be under minion. In providers, grains has to be outside of minion. Updated the documentation to reflect this.