Debian: sw-manager patch-strategy show fails

Bug #1971171 reported by Al Bailey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Al Bailey

Bug Description

Brief Description
-----------------
Running sw-manager patch-strategy show reports a stracktrace on debian

This issue is not related to patching (which is still under construction) but is due to python3 differences.

Severity
--------
Minor

Steps to Reproduce
------------------
source /etc/platform/openrc
sw-manager patch-strategy show

Expected Behavior
------------------
Should report that no strategy is found

Actual Behavior
----------------
Reports a stack trace, and the nfv-vim-api.log shows it is failing while writing to tcp

Reproducibility
---------------
100%

System Configuration
--------------------
Debian AIO-SX

Branch/Pull Time/Commit
-----------------------
May 1, 2022

Last Pass
---------
N/A

Timestamp/Logs
--------------
2022-05-02T13:25:52.440 controller-0 VIM-API_Thread[61586] ERROR Server-side error: "can't concat str to bytes". Detail:
Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/wsmeext/pecan.py", line 84, in callfunction
    result = f(self, *args, **kwargs)

  File "/usr/lib/python3/dist-packages/nfv_vim/api/controllers/v1/orchestration/sw_update/_sw_update_strategy.py", line 485, in get_all
    vim_connection.send(rpc_request.serialize())

  File "/usr/lib/python3/dist-packages/nfv_common/tcp/_tcp_connection.py", line 128, in send
    msg += payload

TypeError: can't concat str to bytes

Test Activity
-------------
Feature Testing

Workaround
----------
None.

Al Bailey (albailey1974)
Changed in starlingx:
assignee: nobody → Al Bailey (albailey1974)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nfv (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/nfv/+/840213

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nfv (master)

Reviewed: https://review.opendev.org/c/starlingx/nfv/+/840213
Committed: https://opendev.org/starlingx/nfv/commit/985739f7fbb2e2961b94707cd2ea93440425ea01
Submitter: "Zuul (22348)"
Branch: master

commit 985739f7fbb2e2961b94707cd2ea93440425ea01
Author: Al Bailey <email address hidden>
Date: Mon May 2 15:24:43 2022 +0000

    Debian: Fix VIM API calls

    On python 2 struct.pack returns a string, and therefore a
    payload of type 'string' can be appended to it, before
    being converted to bytes for writing to tcp.

    On python 3 struct.pack returns bytes, and therefore a
    payload of type 'string' can not be appended to it.
    The payload needs to be converted to bytes first. The
    conversion of bytes to bytes (writing to tcp) is a no-op.

    This change has no impact on python2 code.

    Test Plan:
      PASS: "sw-manager patch-strategy show" does not generate
           exceptions in nfv-vim or nfv-vim-api logs on Debian.

    Closes-Bug: 1971171
    Signed-off-by: Al Bailey <email address hidden>
    Change-Id: Ia4fc56ca20f1e013ad1432802c4f18793ee3bb26

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
tags: added: stx.7.0 stx.debian stx.nfv
Changed in starlingx:
importance: Undecided → Medium
importance: Medium → Low
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.