Lines Matching refs:new
33 """ create backups of each configuration file which also has a .new file
40 for new_file in glob.glob('*.new'):
42 old_file = new_file.replace('.new', '')
52 """ look for deprecated variables and, if found, convert it to the new
109 addition, look for deprecated section/keys and convert them to the new
113 new_file = old_file + '.new'
119 # open the new version
120 new = iniparse.ConfigParser()
122 new.readfp(open(new_file))
125 # The upgrade did not deliver a .new file so, return
159 not new.has_section(new_section)):
160 new.add_section(new_section)
163 new.set(new_section, new_key, value)
166 if new_section != 'DEFAULT' and not new.has_section(new_section):
167 new.add_section(new_section)
170 # to a new value
172 new_value = new.get(new_section, new_key)
178 # the new configuration file does not have this option set so
182 # Only copy the old value to the new conf file if the entry doesn't
183 # exist in the new file or if it contains '%SERVICE'
184 if not new.has_option(new_section, new_key) or \
185 '%SERVICE' in new.get(new_section, new_key):
186 new.set(new_section, new_key, value)
188 # copy the new conf file in place
190 new.write(fh)
194 """ move each entry in mapping from the original file to the new file.
200 # open the new file
201 new = iniparse.ConfigParser()
202 new.readfp(open(new_file))
215 if new_section != 'DEFAULT' and not new.has_section(new_section):
216 new.add_section(new_section)
222 # set the option in the new file
223 new.set(new_section, new_key, original_value)
232 new.write(fh)