From db7ed51e534ca64c8ac8c976d878cd1b627c6798 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 8 Jan 2016 14:02:30 +0530 Subject: [PATCH] networks: Minor update to primary connection fix To make sure 'primary' key is always available in status. --- plinth/network.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plinth/network.py b/plinth/network.py index 7075c21b9..6350ceb51 100644 --- a/plinth/network.py +++ b/plinth/network.py @@ -102,9 +102,10 @@ def get_status_from_connection(connection): status['wireless']['ssid'] = setting_wireless.get_ssid().get_data() primary_connection = nm.Client.new(None).get_primary_connection() - if primary_connection: - status['primary'] = (primary_connection.get_uuid() == - connection.get_uuid()) + status['primary'] = ( + primary_connection and + primary_connection.get_uuid() == connection.get_uuid() + ) return status