Zabbix is not working with Python3

Bug #1898515 reported by Vu Xuan Tuong
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Released
Medium
Vu Xuan Tuong

Bug Description

From the documentation for ast.literal_eval():
Safely evaluate an expression node or a string containing a Python expression. The string or node provided may only consist of the following Python literal structures: strings, numbers, tuples, lists, dicts, booleans, and None.

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/eventlet/greenpool.py", line 88, in _spawn_n_impl
    func(*args, **kwargs)
  File "/opt/stack/tacker/tacker/vnfm/plugin.py", line 455, in create_vnf_wait
    self.add_vnf_to_appmonitor(context, vnf_dict)
  File "/opt/stack/tacker/tacker/vnfm/plugin.py", line 297, in add_vnf_to_appmonitor
    appmonitor = self._vnf_app_monitor.create_app_dict(context, vnf_dict)
  File "/opt/stack/tacker/tacker/vnfm/monitor.py", line 248, in create_app_dict
    return self._create_app_monitoring_dict(dev_attrs, mgmt_ip_address)
  File "/opt/stack/tacker/tacker/vnfm/monitor.py", line 239, in _create_app_monitoring_dict
    temp = ast.literal_eval(mgmt_ip_address)
  File "/usr/lib/python3.6/ast.py", line 85, in literal_eval
    return _convert(node_or_string)
  File "/usr/lib/python3.6/ast.py", line 84, in _convert
    raise ValueError('malformed node or string: ' + repr(node))
ValueError: malformed node or string: b'{"VDU1": "192.168.120.26"}'

Vu Xuan Tuong (tuongvx)
Changed in tacker:
assignee: nobody → Vu Xuan Tuong (tuongvx)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tacker (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/756048

Itsuro Oda (oda-g)
Changed in tacker:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tacker (master)

Reviewed: https://review.opendev.org/756048
Committed: https://git.openstack.org/cgit/openstack/tacker/commit/?id=b8c642a7703f96c1585cc85b7640fd3d716c6e2a
Submitter: Zuul
Branch: master

commit b8c642a7703f96c1585cc85b7640fd3d716c6e2a
Author: Vu Tuong <email address hidden>
Date: Mon Oct 5 11:33:43 2020 +0000

    Fix python3 utf-8 decode issue and typo while creating app_monitor

    This change corrects the input for ast.literal_eval()
    and also corrects the variable (zapi.URL) called in
    zabbix_api.py and zabbix.py.

    From the Python3 documentation for ast.literal_eval():
    Safely evaluate an expression node or a string containing
    a Python expression. The string or node provided may
    only consist of the following Python literal structures:
    strings, numbers, tuples, lists, dicts, booleans, and None.

    Change-Id: I710feff170cb464371d76ef3ee52392fa818c18d
    Related-Bug: #1898515
    Closes-Bug: #1898526

Yasufumi Ogawa (yasufum)
Changed in tacker:
importance: Undecided → Medium
Yasufumi Ogawa (yasufum)
Changed in tacker:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.