* Only update cosmos-modules.conf if a change is needed * Do an atomic replace of the file if updating it * Add a note at the top mentioning that it is tool-generated * Make pylint and black happy Tested in ubuntu 18.04.