Skip to content

Instantly share code, notes, and snippets.

@pgmillon
Created July 3, 2017 10:38
Show Gist options
  • Save pgmillon/3fc92187a0f0b7bff76add0c138f6965 to your computer and use it in GitHub Desktop.
Save pgmillon/3fc92187a0f0b7bff76add0c138f6965 to your computer and use it in GitHub Desktop.
MP version fix script
#!/usr/bin/env python
import ConfigParser
defaults = {'other_versions': None, 'prepared': 'False', 'performed': 'False', 'branched': 'False',
"profiles": '', "auto_increment_policy": "auto_patch"}
release_ini = ConfigParser.SafeConfigParser(defaults=defaults)
mp_config = ConfigParser.SafeConfigParser()
with open('nuxeo/marketplace/release.ini') as fp:
release_ini.readfp(fp)
with open('integration-scripts/marketplace.ini') as fp:
mp_config.readfp(fp)
marketplaces = release_ini.sections()
for marketplace in marketplaces:
print marketplace + ': ' + release_ini.get('DEFAULT', '{0}-tag'.format(marketplace))
mp_config.set(marketplace, 'branch', release_ini.get('DEFAULT', '{0}-tag'.format(marketplace)))
with open('integration-scripts/marketplace.ini', 'w') as fp:
mp_config.write(fp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment