OpenSIPS / opensips-cli

OpenSIPS CLI tool - an interactive command line tool that can be used to control and monitor OpenSIPS servers.
GNU General Public License v3.0
85 stars 48 forks source link

'user add' occurs error with PostgreSQL #26

Closed lu-lu-yu closed 4 years ago

lu-lu-yu commented 5 years ago

hi, when using with postgresql, executing 'user add' reports error "'osdb' object has no attribute 'use'". The detail information is as follows: [root@localhost opensips-cli]# python3 bin/opensips-cli -x user add 1003@192.188.231.40:5060 123456 SQLAlchemy version: 1.3.4 Please provide us the URL of the database: postgres://opensips:opensipsrw@127.0.0.1/postgres Traceback (most recent call last): File "bin/opensips-cli", line 9, in run_console() File "bin/opensips-cli", line 6, in run_console main.main() File "/usr/local/python3/lib/python3.6/site-packages/opensipscli-0.1-py3.6.egg/opensipscli/main.py", line 78, in main sys.exit(shell.cmdloop()) File "/usr/local/python3/lib/python3.6/site-packages/opensipscli-0.1-py3.6.egg/opensipscli/cli.py", line 225, in cmdloop ret = self.run_command(self.command[0], command, params) File "/usr/local/python3/lib/python3.6/site-packages/opensipscli-0.1-py3.6.egg/opensipscli/cli.py", line 331, in run_command return mod[0].invoke(cmd, params) File "/usr/local/python3/lib/python3.6/site-packages/opensipscli-0.1-py3.6.egg/opensipscli/module.py", line 36, in invoke return f(params) File "/usr/local/python3/lib/python3.6/site-packages/opensipscli-0.1-py3.6.egg/opensipscli/modules/user.py", line 103, in do_add db = self.user_db_connect() File "/usr/local/python3/lib/python3.6/site-packages/opensipscli-0.1-py3.6.egg/opensipscli/modules/user.py", line 55, in user_db_connect db.use() AttributeError: 'osdb' object has no attribute 'use'

liviuchircu commented 4 years ago

Hey @lu-lu-yu, this should now be fixed. If you run into any more issues, please open up a separate issue, thanks!