File 0003-main-script-fix-dict_values-object-does-not-support-.patch of Package firewalld-rpcbind-helper.12369

From a5fe86e4263367bfb7142623f991057d3097f0d1 Mon Sep 17 00:00:00 2001
From: Matthias Gerstner <matthias.gerstner@suse.de>
Date: Mon, 19 Aug 2019 14:56:15 +0200
Subject: [PATCH] main script: fix `'dict_values' object does not support
 indexing` error in python3

Fixes: #1

When the else code path is reached in `getPortSuggestion()` the in
python3 the following error can occur:

```
File "/usr/bin/firewall-rpc-helper.py", line 643, in getPortSuggestion
proto = current.values()[0]
TypeError: 'dict_values' object does not support indexing
```

Fix this by explicitly casting to list().
---
 firewall-rpc-helper.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/firewall-rpc-helper.py b/firewall-rpc-helper.py
index 3f6e596..b13c0aa 100755
--- a/firewall-rpc-helper.py
+++ b/firewall-rpc-helper.py
@@ -640,7 +640,7 @@ applicable (currently only firewall-cmd calls)."""),
 				proto = current["udp"]
 			else:
 				# any protocol must do
-				proto = current.values()[0]
+				proto = list(current.values())[0]
 
 			for port in proto:
 				# return the first port (usually only one)
-- 
2.21.0
openSUSE Build Service is sponsored by