proper fix related to the last commit

This commit is contained in:
Miroslav Stampar
2011-06-01 23:00:18 +00:00
parent fd57aae779
commit 8aa5625cd0
3 changed files with 11 additions and 5 deletions

View File

@@ -297,12 +297,15 @@ class Backend:
logger.error("invalid format of versionsList")
@staticmethod
def forceDbms(dbms):
kb.misc.forcedDbms = aliasToDbmsEnum(dbms)
def forceDbms(dbms, sticky=False):
if not kb.misc.stickyFlag:
kb.misc.forcedDbms = aliasToDbmsEnum(dbms)
kb.misc.stickyFlag = sticky
@staticmethod
def flushForcedDbms():
kb.misc.forcedDbms = None
def flushForcedDbms(force=False):
if not kb.misc.stickyFlag or force:
kb.misc.forcedDbms = None
@staticmethod
def setOs(os):

View File

@@ -1403,6 +1403,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
kb.misc.space = ":%s:" % randomStr(length=1, lowercase=True)
kb.misc.dollar = ":%s:" % randomStr(length=1, lowercase=True)
kb.misc.forcedDbms = None
kb.misc.stickyFlag = False
if flushAll:
kb.keywords = set(getFileItems(paths.SQL_KEYWORDS))