From 943efbc9d05e777ae411454a1859a2b14228d07e Mon Sep 17 00:00:00 2001 From: "Kiran.Shrestha" Date: Mon, 12 May 2014 15:16:14 -0400 Subject: [PATCH] ASM #539 - Multiple flag functionality for textdb is not working properly Change-Id: I6f48e877a356fa576e1311da769c90735e61877f Former-commit-id: e615e1efc5866cc68482d2b529f4a54a8ec7ff38 [formerly 2e2de40d75c0ebc0af1b2d70806e834c7d5089f8] Former-commit-id: c16286885097883c3ae2f8d6a18518d5b38ddff2 --- .../com.raytheon.uf.tools.cli/impl/src/textdb/TextDB.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/edexOsgi/com.raytheon.uf.tools.cli/impl/src/textdb/TextDB.py b/edexOsgi/com.raytheon.uf.tools.cli/impl/src/textdb/TextDB.py index a4bbbe55b7..85d272987a 100644 --- a/edexOsgi/com.raytheon.uf.tools.cli/impl/src/textdb/TextDB.py +++ b/edexOsgi/com.raytheon.uf.tools.cli/impl/src/textdb/TextDB.py @@ -58,6 +58,7 @@ import conf.TDBConfig as config # 10/29/10 7354 cjeanbap Updated if-statement to handle None # 12/07/10 7656 cjeanbap Retrieve environment variable. # 04/07/11 8686 cjeanbap Fixed $ACTION has -i associated +# 05/12/14 16954 kshrestha Added Multiple flag functionality for textdb ############################################################################## class TextDB: @@ -226,6 +227,7 @@ class TextDB: msg = MSG.Message(True) msg.initializeMessage(False) commands = self.commands['command'] + isJoin = False for command in commands: data = self.commands[command] message = config.message[command] @@ -233,6 +235,8 @@ class TextDB: for tuple in message[config.MSG_START:]: key = tuple[config.MSG_KEY] value = tuple[config.MSG_VALUE] + if ((key == "SUBOP") and (value == "JOIN")): + isJoin = True if isinstance(value,types.IntType): if args == config.MSG_VAR_ARGS: for item in data: @@ -242,6 +246,9 @@ class TextDB: if ((key == "SITE") and (self.commands.get("site_node") is not None) and (len(self.commands.get("site_node")) == 0)): val = str(os.getenv("sitename")) msg.addProperty(name=key,value=val,replace=True) + elif(isJoin == True): + msg.addProperty(name=key,value=data,replace=True) + isJoin = False else: msg.addProperty(name=key,value=data[value],replace=True) else: @@ -472,7 +479,7 @@ class TextDB: subJoins = self.commands.get(key) length = len(self.commands.get(key)) #specifically looking for config.flags of subJoins - if length == 6: + if length <= 6: for pos in range(0, length, 2): value = config.flags.get(subJoins[pos])[0] try: