When creating a iSCSI pool, the iSCSI targets were listed twice on
openSUSE systems as returned by iscsiadm.
opensuse-vm:~ # iscsiadm -m discovery -t sendtargets -p localhost
[::1]:3260,1 iqn.2014-09.mydomain:alinefm
[fe80::5054:ff:fe29:5551]:3260,1 iqn.2014-09.mydomain:alinefm
To avoid confusion, display unique values.
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
src/kimchi/model/storagetargets.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/kimchi/model/storagetargets.py b/src/kimchi/model/storagetargets.py
index dd72814..30717fd 100644
--- a/src/kimchi/model/storagetargets.py
+++ b/src/kimchi/model/storagetargets.py
@@ -83,7 +83,7 @@ class StorageTargetsModel(object):
# Filter target_list to not not show the used paths
target_list = [elem for elem in target_list
if elem.get('target') not in used_paths]
- return target_list
+ return [dict(t) for t in set(tuple(t.items()) for t in target_list)]
def _get_storage_server_spec(self, **kwargs):
# Required parameters:
--
1.9.3