ovs-monitor-ipsec: Fix use_ssl_cert option implementation.
[openvswitch] / debian / ovs-monitor-ipsec
index f7bdf1da0c02ce8628ea399f6440e6466312b213..ac2cd7e1777da8d3f3e42d7a75a113f4e0cfdaf3 100755 (executable)
@@ -413,9 +413,10 @@ def update_ipsec(ipsec, interfaces, new_interfaces):
 
 def get_ssl_cert(data):
     for ovs_rec in data["Open_vSwitch"].rows.itervalues():
-        ssl = ovs_rec.ssl
-        if ssl and ssl.certificate and ssl.private_key:
-            return (ssl.certificate, ssl.private_key)
+        if ovs_rec.ssl:
+            ssl = ovs_rec.ssl[0]
+            if ssl.certificate and ssl.private_key:
+                return (ssl.certificate, ssl.private_key)
 
     return None