Omaha #2926 fixed sub operation check in TextDB script
Change-Id: Icd2971efeff3ffb29df3bd56bf318ad57cae0a6b Former-commit-id:1b11339467
[formerlya75af54f30
] [formerly507deef29c
] [formerly1b11339467
[formerlya75af54f30
] [formerly507deef29c
] [formerly72335f48c6
[formerly507deef29c
[formerly f77509e176afbdf7bfc75da107bf76fc841653d4]]]] Former-commit-id:72335f48c6
Former-commit-id:47ba2fb91c
[formerly0f61cfd95c
] [formerly 4862d2910c568708ca8c235fcfd41be40bb1dcd6 [formerly8d03015b6a
]] Former-commit-id: 6efefd83ea61bf784992c77b00909107b8b07218 [formerly4590cea17b
] Former-commit-id:4d20bc10f6
This commit is contained in:
parent
b69c4ce511
commit
ba2be6b605
1 changed files with 11 additions and 16 deletions
|
@ -59,6 +59,7 @@ import conf.TDBConfig as config
|
|||
# 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
|
||||
# 08/15/14 2926 bclement Fixed hasSubOperations()
|
||||
##############################################################################
|
||||
class TextDB:
|
||||
|
||||
|
@ -470,27 +471,21 @@ class TextDB:
|
|||
sm.execute()
|
||||
|
||||
# Determine if command line has sub operations
|
||||
# Returns true if any flags in self.commands[CL.DEFAULT_KEY]
|
||||
# are in config.mayJoin
|
||||
#
|
||||
# raise:
|
||||
# propagates any exception received
|
||||
def __hasSubOperations(self):
|
||||
for key in self.commands.keys():
|
||||
for key in self.commands.keys():
|
||||
if key is CL.DEFAULT_KEY:
|
||||
subJoins = self.commands.get(key)
|
||||
length = len(self.commands.get(key))
|
||||
flags = self.commands.get(key)
|
||||
#specifically looking for config.flags of subJoins
|
||||
if length <= 6:
|
||||
for pos in range(0, length, 2):
|
||||
value = config.flags.get(subJoins[pos])[0]
|
||||
try:
|
||||
config.mayJoin.index(value)
|
||||
except:
|
||||
raise CL.ArgError("Invalid command count - JOIN command includes invalid option(s)")
|
||||
for flag in flags:
|
||||
configFlag = config.flags.get(flag)
|
||||
# some flags aren't in configs.flags
|
||||
if configFlag and configFlag[0] in config.mayJoin:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
else:
|
||||
return False
|
||||
return False
|
||||
|
||||
# Correct the sub operational command line .
|
||||
#
|
||||
#
|
||||
|
|
Loading…
Add table
Reference in a new issue