Blob Blame History Raw
From 1eb5d5c57edb6e35895fa4ae4314f652da423d92 Mon Sep 17 00:00:00 2001
From: Eric Garver <eric@garver.life>
Date: Fri, 24 Apr 2020 11:27:10 -0400
Subject: [PATCH 15/45] fix(client): addService needs to reduce tuple size

The dbus API only allows 8 elements. Reduce the tuple to the correct
size as it's common for clients to do

    settings =  FirewallClientServiceSettings()
    [..]
    addService(settings.settings)

(cherry picked from commit e2ab8a6e584e6ba2adb0a5e0a13fbb6d7eb39b0c)
(cherry picked from commit 3eae583907a953b71df16747bbabefd24fbdc3ab)
---
 src/firewall/client.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/firewall/client.py b/src/firewall/client.py
index efe5d7db1273..ea27c0186509 100644
--- a/src/firewall/client.py
+++ b/src/firewall/client.py
@@ -2488,7 +2488,9 @@ class FirewallClientConfig(object):
         elif type(settings) is dict:
             path = self.fw_config.addService2(name, settings)
         else:
-            path = self.fw_config.addService(name, tuple(settings))
+            # tuple based dbus API has 8 elements. Slice what we're given down
+            # to the expected size.
+            path = self.fw_config.addService(name, tuple(settings[:8]))
         return FirewallClientConfigService(self.bus, path)
 
     # icmptype
-- 
2.27.0