Changeset 8b1769 in indico
- Timestamp:
- 02/18/10 15:21:06 (3 years ago)
- Branches:
- master, burotel, hello-world-walkthrough, ipv6, new-webex, prov-dual-interface, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 43311dd25516d54f5852ee459948998035e08952
- Children:
- 24a4db
- Parents:
- 91d2ae
- File:
-
- 1 edited
-
indico/MaKaC/consoleScripts/installBase.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/consoleScripts/installBase.py
r9def33 r8b1769 91 91 new_values.update(mixinValues) 92 92 93 93 94 # We have to preserve options not currently present in the bundled indico.conf because they 94 95 # may belong to a plugin. This functionality can lead to forget adding new options to … … 103 104 # We update a current copy of indico.conf with the new values 104 105 new_contents = open(new_conf).read() 106 105 107 for k in new_values: 106 108 if new_values[k].__class__ == str: … … 125 127 126 128 elif new_values[k].__class__ == dict: 127 regexp = re.compile('^(%s[ ]*=[ ]*)[\{] {1}([^\}]+)[\}]{1}' % k, re.MULTILINE)129 regexp = re.compile('^(%s[ ]*=[ ]*)[\{](.+)[\}$]' % k, re.MULTILINE) 128 130 if regexp.search(new_contents): 129 131 new_contents = re.sub(regexp, "\\g<1>%s" % str(result_values[k]), new_contents) … … 141 143 142 144 # We write unknown options to the end of the file, they may not be just outdated options but plugins' 145 143 146 open(existing_conf, 'w').write(new_contents) 144 147 … … 485 488 del targetDirs['db'] 486 489 490 print "Creating directories for resources... ", 487 491 # Create the directories where the resources will be installed 488 492 createDirs(targetDirs) 493 print "done!" 489 494 490 495 # target configuration file (may exist or not) 491 496 newConf = os.path.join(targetDirs['etc'],'indico.conf') 492 497 # source configuration file (package) 493 sourceConf = os.path.join(sourceDirs['etc'], 'indico.conf ')498 sourceConf = os.path.join(sourceDirs['etc'], 'indico.conf.sample') 494 499 495 500 # if there is a source config … … 499 504 shutil.copy(sourceConf, newConf) 500 505 else: 506 print "Upgrading indico.conf...", 501 507 # upgrade the existing one 502 upgrade_indico_conf(sourceConf, newConf) 508 upgrade_indico_conf(newConf, sourceConf) 509 print "done!" 503 510 504 511 # change MaKaCConfig.py to include the config
Note: See TracChangeset
for help on using the changeset viewer.
