ossobv / asterisklint

Asterisk PBX configuration syntax checker
GNU General Public License v3.0
63 stars 12 forks source link

Nested function causes exception #40

Open jjsearle opened 5 years ago

jjsearle commented 5 years ago
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/asterisklint/config.py", line 186, in __iter__
    self.on_varset(element)
  File "/usr/local/lib/python3.6/site-packages/asterisklint/dialplan.py", line 600, in on_varset
    dialplanvarset = DialplanVarset.from_varset(varset)
  File "/usr/local/lib/python3.6/site-packages/asterisklint/dialplan.py", line 508, in from_varset
    app = App(app, varset.where)
  File "/usr/local/lib/python3.6/site-packages/asterisklint/application.py", line 111, in __init__
    self.parse()
  File "/usr/local/lib/python3.6/site-packages/asterisklint/application.py", line 134, in parse
    self.data = self.parse_inner(self.data)
  File "/usr/local/lib/python3.6/site-packages/asterisklint/application.py", line 149, in parse_inner
    data = VarLoader().parse_variables(data, self.where)
  File "/usr/local/lib/python3.6/site-packages/asterisklint/varfun.py", line 289, in parse_variables
    inner_data, where)
  File "/usr/local/lib/python3.6/site-packages/asterisklint/varfun.py", line 330, in _process_variable
    return FuncLoader().process_read_function(data, where)
  File "/usr/local/lib/python3.6/site-packages/asterisklint/varfun.py", line 178, in process_read_function
    loaded_func = FuncLoader()._get_and_check_availability(func, where)
  File "/usr/local/lib/python3.6/site-packages/asterisklint/varfun.py", line 206, in _get_and_check_availability
    loaded = FuncLoader().get(func.lower())
AttributeError: 'list' object has no attribute 'lower'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/asterisklint", line 34, in <module>
    sys.exit(main(sys.argv[1:], os.environ))
  File "/usr/local/lib/python3.6/site-packages/asterisklint/main.py", line 178, in main
    return command_module.main(args, envs)
  File "/usr/local/lib/python3.6/site-packages/asterisklint/mainutil.py", line 35, in __call__
    return self.handle_args(args)
  File "/usr/local/lib/python3.6/site-packages/asterisklint/commands/dialplan-check.py", line 50, in handle_args
    dialplan = next(iter(parser))
  File "/usr/local/lib/python3.6/site-packages/asterisklint/config.py", line 192, in __iter__
    raise ProgrammingError(str(element.where)) from exc
asterisklint.config.ProgrammingError: An unexpected exception was raised. This is most likely a bug in the asterisklint library. If you can reproduce the problem and file an issue on the bug tracker, that would be nice. Further info: ./extensions.conf:1069

The line of dialplan that caused the exception

same => n,Set(is_open=${ODBC_CHECK_TIMESET_${TOUPPER(${STRFTIME(,,%a)})}(${ARG1})})