Closed lzhecheng closed 4 years ago
Hi, I found that in https://github.com/openvswitch/ovs/blob/master/ipsec/ovs-monitor-ipsec.in, there are still some Python2 style code like iteritems
iteritems
https://github.com/openvswitch/ovs/blob/master/ipsec/ovs-monitor-ipsec.in#L343 https://github.com/openvswitch/ovs/blob/master/ipsec/ovs-monitor-ipsec.in#L539 https://github.com/openvswitch/ovs/blob/master/ipsec/ovs-monitor-ipsec.in#L1050 https://github.com/openvswitch/ovs/blob/master/ipsec/ovs-monitor-ipsec.in#L1050
I found this as after I compiled ovs deb files, I was trying to install openvswitch-ipsec_2.13.0-1_amd64.deb. But it failed saying that:
openvswitch-ipsec_2.13.0-1_amd64.deb
2020-08-05T12:44:53.5975262Z + sudo dpkg -i openvswitch-ipsec_2.13.0-1_amd64.deb 2020-08-05T12:44:53.6338853Z Selecting previously unselected package openvswitch-ipsec. 2020-08-05T12:44:53.7169893Z (Reading database ... 260639 files and directories currently installed.) 2020-08-05T12:44:53.7278519Z Preparing to unpack openvswitch-ipsec_2.13.0-1_amd64.deb ... 2020-08-05T12:44:53.7290719Z Unpacking openvswitch-ipsec (2.13.0-1) ... 2020-08-05T12:44:53.7451670Z Setting up openvswitch-ipsec (2.13.0-1) ... 2020-08-05T12:44:56.4865303Z Job for openvswitch-ipsec.service failed because the control process exited with error code. 2020-08-05T12:44:56.4866649Z See "systemctl status openvswitch-ipsec.service" and "journalctl -xe" for details. 2020-08-05T12:44:56.4877039Z invoke-rc.d: initscript openvswitch-ipsec, action "start" failed. 2020-08-05T12:44:56.5417689Z ● openvswitch-ipsec.service - LSB: Open vSwitch GRE-over-IPsec daemon 2020-08-05T12:44:56.5418682Z Loaded: loaded (/etc/init.d/openvswitch-ipsec; generated) 2020-08-05T12:44:56.5419300Z Active: failed (Result: exit-code) since Wed 2020-08-05 12:44:56 UTC; 10ms ago 2020-08-05T12:44:56.5419812Z Docs: man:systemd-sysv-generator(8) 2020-08-05T12:44:56.5420608Z Process: 28522 ExecStart=/etc/init.d/openvswitch-ipsec start (code=exited, status=1/FAILURE) 2020-08-05T12:44:56.5421082Z Tasks: 20 (limit: 8269) 2020-08-05T12:44:56.5421718Z CGroup: /system.slice/openvswitch-ipsec.service 2020-08-05T12:44:56.5422021Z ├─28599 /usr/lib/ipsec/starter --daemon charon 2020-08-05T12:44:56.5422309Z ├─28600 /usr/lib/ipsec/charon --use-syslog 2020-08-05T12:44:56.5422869Z ├─28632 /usr/bin/python3 /usr/share/openvswitch/scripts/ovs-monitor-ipsec --pidfile=/var/run/openvswitch/ovs-monitor-ipsec.pid --ike-daemon=strongswan --log-file --detach --monitor unix:/var/run/openvswitch/db.sock 2020-08-05T12:44:56.5423874Z └─28634 /usr/bin/python3 /usr/share/openvswitch/scripts/ovs-monitor-ipsec --pidfile=/var/run/openvswitch/ovs-monitor-ipsec.pid --ike-daemon=strongswan --log-file --detach --monitor unix:/var/run/openvswitch/db.sock 2020-08-05T12:44:56.5423989Z 2020-08-05T12:44:56.5424335Z Aug 05 12:44:56 fv-az51 ipsec_starter[28599]: charon (28600) started after 20 ms 2020-08-05T12:44:56.5424704Z Aug 05 12:44:56 fv-az51 ovs-monitor-ips[28633]: ovs| 2 | reconnect | INFO | unix:/var/run/openvswitch/db.sock: connecting... 2020-08-05T12:44:56.5425055Z Aug 05 12:44:56 fv-az51 ovs-monitor-ips[28633]: ovs| 4 | ovs-monitor-ipsec | ERR | traceback 2020-08-05T12:44:56.5425274Z Traceback (most recent call last): 2020-08-05T12:44:56.5425705Z File "/usr/share/openvswitch/scripts/ovs-monitor-ipsec", line 1229, in <module> 2020-08-05T12:44:56.5425899Z main() 2020-08-05T12:44:56.5426493Z File "/usr/share/openvswitch/scripts/ovs-monitor-ipsec", line 1216, in main 2020-08-05T12:44:56.5426683Z monitor.run() 2020-08-05T12:44:56.5427476Z File "/usr/share/openvswitch/scripts/ovs-monitor-ipsec", line 1067, in run 2020-08-05T12:44:56.5427714Z for name, tunnel in self.tunnels.iteritems(): 2020-08-05T12:44:56.5428211Z AttributeError: 'dict' object has no attribute 'iteritems' 2020-08-05T12:44:56.5428489Z Aug 05 12:44:56 fv-az51 openvswitch-ipsec[28522]: ...fail! 2020-08-05T12:44:56.5428790Z Aug 05 12:44:56 fv-az51 systemd[1]: openvswitch-ipsec.service: Control process exited, code=exited status=1 2020-08-05T12:44:56.5429087Z Aug 05 12:44:56 fv-az51 systemd[1]: openvswitch-ipsec.service: Failed with result 'exit-code'. 2020-08-05T12:44:56.5429379Z Aug 05 12:44:56 fv-az51 systemd[1]: Failed to start LSB: Open vSwitch GRE-over-IPsec daemon. 2020-08-05T12:44:56.5429680Z Aug 05 12:44:56 fv-az51 ovs-monitor-ips[28632]: ovs| 2 | daemon | ERR | pid 28633 died, exit status 5, restarting 2020-08-05T12:44:56.5430007Z Aug 05 12:44:56 fv-az51 ovs-monitor-ips[28634]: ovs| 3 | reconnect | INFO | unix:/var/run/openvswitch/db.sock: connecting... 2020-08-05T12:44:56.5430305Z Aug 05 12:44:56 fv-az51 ovs-monitor-ips[28634]: ovs| 5 | ovs-monitor-ipsec | ERR | traceback 2020-08-05T12:44:56.5430511Z Traceback (most recent call last): 2020-08-05T12:44:56.5431408Z File "/usr/share/openvswitch/scripts/ovs-monitor-ipsec", line 1229, in <module> 2020-08-05T12:44:56.5431646Z main() 2020-08-05T12:44:56.5432187Z File "/usr/share/openvswitch/scripts/ovs-monitor-ipsec", line 1216, in main 2020-08-05T12:44:56.5432433Z monitor.run() 2020-08-05T12:44:56.5432978Z File "/usr/share/openvswitch/scripts/ovs-monitor-ipsec", line 1067, in run 2020-08-05T12:44:56.5433276Z for name, tunnel in self.tunnels.iteritems(): 2020-08-05T12:44:56.5433771Z AttributeError: 'dict' object has no attribute 'iteritems' 2020-08-05T12:44:56.5434372Z dpkg: error processing package openvswitch-ipsec (--install): 2020-08-05T12:44:56.5435101Z installed openvswitch-ipsec package post-installation script subprocess returned error exit status 1 2020-08-05T12:44:56.5435437Z Aug 05 12:44:56 fv-az51 ovs-monitor-ips[28632]: ovs| 3 | daemon | WARN | pid 28634 died, exit status 5, waiting until 10 seconds since last restart 2020-08-05T12:44:56.5435734Z Processing triggers for ureadahead (0.100.0-21) ... 2020-08-05T12:44:56.5555532Z Processing triggers for systemd (237-3ubuntu10.41) ... 2020-08-05T12:44:56.7177018Z Errors were encountered while processing: 2020-08-05T12:44:56.7178320Z openvswitch-ipsec 2020-08-05T12:44:56.7197230Z ##[error]Process completed with exit code 1.
Patch from https://github.com/openvswitch/ovs/pull/331 was merged. So, closing this issue.
Hi, I found that in https://github.com/openvswitch/ovs/blob/master/ipsec/ovs-monitor-ipsec.in, there are still some Python2 style code like
iteritems
https://github.com/openvswitch/ovs/blob/master/ipsec/ovs-monitor-ipsec.in#L343 https://github.com/openvswitch/ovs/blob/master/ipsec/ovs-monitor-ipsec.in#L539 https://github.com/openvswitch/ovs/blob/master/ipsec/ovs-monitor-ipsec.in#L1050 https://github.com/openvswitch/ovs/blob/master/ipsec/ovs-monitor-ipsec.in#L1050
I found this as after I compiled ovs deb files, I was trying to install
openvswitch-ipsec_2.13.0-1_amd64.deb
. But it failed saying that: