I'm fairly new at Python and can't seem to get this to work. I have a list which has an imbedded list of objects which are the names of functions and I need to execute the list of objects. I have functions that call lists of functions. I want to change this so I can call the list of functions directly without calling another function.
validActions=[
['Refresh','Environment Refresh',Refresh],
['Retire','Environment Retire Storage',
[ doStatusDecommission,
doPauseJobBeforeStart,
doRetireStorage,
doStatusDisconnected]],
['Provision','Environment Provision Storage',Provision]
]
def updateEnv(ctx):
for actionVal,actionDesc,actionFunction in validActions:
if ctx["newAction"] == actionVal:
actionFunction()
This works if I'm calling "Refresh" or "Provision" as they are functions. However, this does not work when I call the list for "Retire" and the error message is
TypeError: 'list' object is not callable