The FDP team is no longer accepting new bugs in Bugzilla. Please report your issues under FDP project in Jira. Thanks.
Bug 1780563 - SyntaxError: Missing parentheses in call to 'print'
Summary: SyntaxError: Missing parentheses in call to 'print'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Fast Datapath
Classification: Red Hat
Component: openvswitch2.12
Version: RHEL 8.0
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Timothy Redaelli
QA Contact: Rick Alongi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-06 11:57 UTC by Timothy Redaelli
Modified: 2020-09-21 02:59 UTC (History)
9 users (show)

Fixed In Version: openvswitch2.12-2.12.0-11.el8fdp
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1751161
Environment:
Last Closed: 2020-01-22 04:03:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:0172 0 None None None 2020-01-22 04:03:57 UTC

Description Timothy Redaelli 2019-12-06 11:57:13 UTC
+++ This bug was initially created as a clone of Bug #1751161 +++

Description of problem:
-----------------------------------------------------------------------------------
Error message would be observed if execute ovs-check-dead-ifs in Red Hat Enterprise Linux 8
-----------------------------------------------------------------------------------

Version-Release number of selected component (if applicable):
-----------------------------------------------------------------------------------
# cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.0 (Ootpa)

# uname -a
Linux haclustern2 4.18.0-80.11.1.el8_0.x86_64 #1 SMP Tue Sep 3 11:21:25 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

openvswitch2.11-2.11.0-18.el8fdp.x86_64
-----------------------------------------------------------------------------------
How reproducible:
-----------------------------------------------------------------------------------
execute the file via /usr/share/openvswitch/scripts 

# ovs-check-dead-ifs 
  File "/usr/share/openvswitch/scripts/ovs-check-dead-ifs", line 40
    print "%s: unexpected format\n" % fn
                                  ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("%s: unexpected format\n" % fn)?

-----------------------------------------------------------------------------------

Steps to Reproduce:
-----------------------------------------------------------------------------------
1. execute the file via /usr/share/openvswitch/scripts 
-----------------------------------------------------------------------------------

Actual results:
-----------------------------------------------------------------------------------
  File "/usr/share/openvswitch/scripts/ovs-check-dead-ifs", line 40
    print "%s: unexpected format\n" % fn
                                  ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("%s: unexpected format\n" % fn)?
-----------------------------------------------------------------------------------

Expected results:
-----------------------------------------------------------------------------------
no error should be observed 
-----------------------------------------------------------------------------------

Additional info:
-----------------------------------------------------------------------------------
ovs-check-dead-ifs is developed by python and would follow python 2.x syntax. However, by default, Red Hat Enterprise Linux 8 uses python3. The print call is different in python2.x and python3. So when ovs-check-dead-ifs executes in Red Hat Enterprise Linux 8, error message can be observed.

We should modify the python code for ovs-check-dead-ifs

1. Line 40, update from 'print "%s: unexpected format\n" % fn' to 'print ("%s: unexpected format\n" % fn)''

2. Line 100 update from ' print """
The following processes are listening for packets to arrive on network devices
that no longer exist. You may want to restart them."""'' to 'print ("""
The following processes are listening for packets to arrive on network devices
that no longer exist. You may want to restart them.""")'
-----------------------------------------------------------------------------------

--- Additional comment from Aaron Conole on 2019-09-13 19:29:28 CEST ---

https://mail.openvswitch.org/pipermail/ovs-dev/2019-September/362691.html

Comment 3 Rick Alongi 2019-12-19 17:57:53 UTC
Reproduced issue as follows:

[root@impairment2 scripts]# rpm -qa | grep openvswitch
openvswitch-selinux-extra-policy-1.0-19.el8fdp.noarch
openvswitch2.12-2.12.0-4.el8fdp.x86_64

[root@impairment2 scripts]# uname -r
4.18.0-147.el8.x86_64

cd /usr/share/openvswitch/scripts/

[root@impairment2 scripts]# ./ovs-check-dead-ifs
  File "./ovs-check-dead-ifs", line 40
    print "%s: unexpected format\n" % fn
                                  ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("%s: unexpected format\n" % fn)?

------------------------------------------------------------------

Upgraded to openvswitch2.12-2.12.0-12.el8fdp:

[root@impairment2 scripts]# yum -y update http://download.eng.bos.redhat.com/brewroot/packages/openvswitch2.12/2.12.0/12.el8fdp/x86_64/openvswitch2.12-2.12.0-12.el8fdp.x86_64.rpm
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:05:51 ago on Thu 19 Dec 2019 12:50:21 PM EST.
openvswitch2.12-2.12.0-12.el8fdp.x86_64.rpm                56 MB/s |  12 MB     00:00    
Dependencies resolved.
==========================================================================================
 Package                Architecture  Version                   Repository           Size
==========================================================================================
Upgrading:
 openvswitch2.12        x86_64        2.12.0-12.el8fdp          @commandline         12 M

Transaction Summary
==========================================================================================
Upgrade  1 Package

Total size: 12 M
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                  1/1 
  Running scriptlet: openvswitch2.12-2.12.0-12.el8fdp.x86_64                          1/1 
  Running scriptlet: openvswitch2.12-2.12.0-12.el8fdp.x86_64                          1/2 
  Upgrading        : openvswitch2.12-2.12.0-12.el8fdp.x86_64                          1/2 
  Running scriptlet: openvswitch2.12-2.12.0-12.el8fdp.x86_64                          1/2 
  Running scriptlet: openvswitch2.12-2.12.0-4.el8fdp.x86_64                           2/2 
  Cleanup          : openvswitch2.12-2.12.0-4.el8fdp.x86_64                           2/2 
  Running scriptlet: openvswitch2.12-2.12.0-4.el8fdp.x86_64                           2/2 
  Verifying        : openvswitch2.12-2.12.0-12.el8fdp.x86_64                          1/2 
  Verifying        : openvswitch2.12-2.12.0-4.el8fdp.x86_64                           2/2 
Installed products updated.

Upgraded:
  openvswitch2.12-2.12.0-12.el8fdp.x86_64                                                 

Complete!

Verified that issue is no longer present:

[root@impairment2 scripts]# ./ovs-check-dead-ifs
[root@impairment2 scripts]#

Comment 5 errata-xmlrpc 2020-01-22 04:03:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:0172


Note You need to log in before you can comment on or make changes to this bug.