(Migrated) Is that a bug to setting outgoing SQL connection?

(This message has been automatically imported from the retired mailing list)

Hi all,

     We need to set connect_args in Extra to outgoing SQL connection, what we will set is as follows,
              connect_args={"charset":"utf8", "init_command":"SET time_zone = '+8:00'"}

     So there apprear two = in Extra. When we saved that configuration, the following exception occurred,
     2016-03-09 14:02:35,737 - ERROR - 6166:Dummy-1144 - zato.server.base:22 - Could not handle broker msg:[Bunch(action=u'100812', cluster_id=1L, db_name=u'system', engine=u'mysql+pymysql', extra=u'connect_args={"charset":"utf8", "init_command":"SET time_zone = \'+8:00\'"}', host=u'10.168.3.111', id=17L, is_active=True, msg_type=u'0002', name=u'system_jp', old_name=u'system_jp', password=u'data_transfer_jp', pool_size=100L, port=3306L, username=u'data_transfer')], e:[Traceback (most recent call last):

File “/opt/zato/2.0.7/zato-server/src/zato/server/base/init.py”, line 47, in on_broker_msg
getattr(self, handler)(msg)
File “/opt/zato/2.0.7/zato-server/src/zato/server/base/worker.py”, line 1049, in on_broker_msg_OUTGOING_SQL_CREATE_EDIT
self.sql_pool_store[msg[‘name’]] = msg
File “/opt/zato/2.0.7/zato-server/src/zato/server/connection/sql.py”, line 200, in setitem
pool = self.sql_conn_class(name, config, config_no_sensitive)
File “/opt/zato/2.0.7/zato-server/src/zato/server/connection/sql.py”, line 93, in init
_extra.update(parse_extra_into_dict(extra))
File “/opt/zato/2.0.7/zato-common/src/zato/common/util.py”, line 827, in parse_extra_into_dict
raise ValueError(‘Each line must be a single key=value entry, not [{}]’.format(original_line))
ValueError: Each line must be a single key=value entry, not [connect_args={“charset”:“utf8”, “init_command”:“SET time_zone = ‘+8:00’”}]
]

     It seems only one = is allowed to fill in Extra, when we changed part of the method parse_extra_into_dict in /opt/zato/2.0.7/zato-common/src/zato/common/util.py to follows, and then we can save that configuration successfully.

              if not len(line) == 2:
               #raise ValueError('Each line must be a single key=value entry, not [{}]'.format(original_line))
               line = [line[0], '='.join(line[1:])]


     Is that a bug which you should fix?

is that a bug?

Thanks,
wangxi

=====================================================================
GenScript -