if type(value) == bool:
value = 'true' if value else 'false'
elif type(value) != int:
- value = "'" + str(value).replace('%instancename%', self.identifier) + "'"
+ value = str(value).replace('%instancename%', self.identifier)
+ value = re.sub(r'%instancename:(\d*)%',
+ lambda m: self.identifier.split(C.get('wording.prefixSeparator'))[int(m.group(1))],
+ value)
+ value = "'" + value + "'"
value = str(value)
try:
try:
if isinstance(cfgValue, basestring):
cfgValue = cfgValue.replace('%instancename%', self.identifier)
+ cfgValue = re.sub(r'%instancename:(\d*)%',
+ lambda m: self.identifier.split(C.get('wording.prefixSeparator'))[int(m.group(1))],
+ cfgValue)
logging.info('Setting up forced $CFG->%s to \'%s\' in config.php', cfgKey, cfgValue)
self.addConfig(cfgKey, cfgValue)
return False
def isStable(self):
- """Assume an instance is stable if not integration"""
- return not self.isIntegration()
+ """Returns whether an instance is a stable one or not"""
+ name = self.identifier.split(C.get('wording.prefixSeparator'))[0]
+ return name == C.get('wording.prefixStable')
+
+ def isReview(self):
+ """Returns whether an instance is a review one or not"""
+ name = self.identifier.split(C.get('wording.prefixSeparator'))[0]
+ return name == C.get('wording.prefixReview')
def _load(self):
"""Loads the information"""