ossobv / asterisklint

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

AttributeError: 'list' object has no attribute 'split' with v0.40 #17

Closed ghost closed 7 years ago

ghost commented 7 years ago

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_choosevoice.conf:6

Here are lines 5,6 and 7 of the offending file:

same => n,Verbose(1,${languages})
same => n,While($["${SET(languagenumber=${SHIFT(languages)})}" != ""])
same => n,Gosub(choosevoice,getlangitems,1(${languagenumber}))

And here is the error in full:


/etc/asterisk# asterisklint dialplan-check extensions.conf
func_odbc.conf:88 E_CONF_KEY_INVALID: expected valid var/object or new context, got 'syntax'
func_odbc.conf:89 W_CONF_KEY_LATE: expected varset 'synopsis' earlier, fix your ordering
func_odbc.conf:96 W_WSV_EOF: unexpected vertical space at end of file
extensions.conf:97 W_APP_BAD_CASE: app 'agi' does not have the proper Case 'AGI'
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/config.py", line 186, in __iter__
    self.on_varset(element)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/dialplan.py", line 591, in on_varset
    dialplanvarset = DialplanVarset.from_varset(varset)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/dialplan.py", line 499, in from_varset
    app = App(app, varset.where)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/application.py", line 111, in __init__
    self.parse()
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/application.py", line 134, in parse
    self.data = self.parse_inner(self.data)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/application.py", line 149, in parse_inner
    data = VarLoader().parse_variables(data, self.where)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/varfun.py", line 284, in parse_variables
    inner_data, where)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/varfun.py", line 288, in parse_variables
    inner_data, where)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/varfun.py", line 329, in _process_variable
    return FuncLoader().process_read_function(data, where)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/varfun.py", line 178, in process_read_function
    loaded_func(args, where=where)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/func/vall/func_logic.py", line 43, in __call__
    VarLoader().parse_assignment(data, where)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/varfun.py", line 236, in parse_assignment
    dest, value = data.split('=', 1)
AttributeError: 'list' object has no attribute 'split'

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.5/dist-packages/asterisklint/main.py", line 147, in main
    return command_module.main(args, envs)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/mainutil.py", line 35, in __call__
    return self.handle_args(args)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/commands/dialplan-check.py", line 50, in handle_args
    dialplan = next(iter(parser))
  File "/usr/local/lib/python3.5/dist-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_choosevoice.conf:6
root@televox:/etc/asterisk# asterisklint dialplan-check extensions.conf
func_odbc.conf:88 E_CONF_KEY_INVALID: expected valid var/object or new context, got 'syntax'
func_odbc.conf:89 W_CONF_KEY_LATE: expected varset 'synopsis' earlier, fix your ordering
func_odbc.conf:96 W_WSV_EOF: unexpected vertical space at end of file
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/config.py", line 186, in __iter__
    self.on_varset(element)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/dialplan.py", line 591, in on_varset
    dialplanvarset = DialplanVarset.from_varset(varset)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/dialplan.py", line 499, in from_varset
    app = App(app, varset.where)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/application.py", line 111, in __init__
    self.parse()
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/application.py", line 134, in parse
    self.data = self.parse_inner(self.data)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/application.py", line 149, in parse_inner
    data = VarLoader().parse_variables(data, self.where)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/varfun.py", line 284, in parse_variables
    inner_data, where)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/varfun.py", line 288, in parse_variables
    inner_data, where)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/varfun.py", line 329, in _process_variable
    return FuncLoader().process_read_function(data, where)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/varfun.py", line 178, in process_read_function
    loaded_func(args, where=where)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/func/vall/func_logic.py", line 43, in __call__
    VarLoader().parse_assignment(data, where)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/varfun.py", line 236, in parse_assignment
    dest, value = data.split('=', 1)
AttributeError: 'list' object has no attribute 'split'

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.5/dist-packages/asterisklint/main.py", line 147, in main
    return command_module.main(args, envs)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/mainutil.py", line 35, in __call__
    return self.handle_args(args)
  File "/usr/local/lib/python3.5/dist-packages/asterisklint/commands/dialplan-check.py", line 50, in handle_args
    dialplan = next(iter(parser))
  File "/usr/local/lib/python3.5/dist-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_choosevoice.conf:6```