From 4fcba5db9329d4435b95e9d3dd33541a81be2e4d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Dalleau?=
 <frederic.dalleau@collabora.co.uk>
Date: Mon, 19 Sep 2016 12:21:19 +0000
Subject: [PATCH] bluez: Fix dictionnary key usage
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This syntax is wrong, it generates the following error:
File "/usr/lib/python3/dist-packages/apertis_tests_lib/bluez.py", line
  557, in __show_menu
      name = str(i['org.bluez.Device1'].get(['Name'], address))
      TypeError: unhashable type: 'list'

Signed-off-by: Frédéric Dalleau <frederic.dalleau@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D4340
---
 apertis_tests_lib/bluez.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apertis_tests_lib/bluez.py b/apertis_tests_lib/bluez.py
index bf318e35..21a4c958 100644
--- a/apertis_tests_lib/bluez.py
+++ b/apertis_tests_lib/bluez.py
@@ -554,7 +554,7 @@ class AdapterDeviceTester():
                i['org.bluez.Device1']['Adapter'] == \
                self.__adapter_obj.object_path:
                 address = str(i['org.bluez.Device1']['Address'])
-                name = str(i['org.bluez.Device1'].get(['Name'], address))
+                name = str(i['org.bluez.Device1'].get('Name', address))
 
                 print('%s: %s, %s' % (p, address, name))
         device_path = input("Select one device to pair with: ")
-- 
GitLab