Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAjay Garg <ajay@activitycentral.com>2012-03-09 11:23:14 (GMT)
committer Anish Mangal <anish@activitycentral.com>2012-04-27 10:02:36 (GMT)
commit3d4159e4b2e1dd72d914c1c76f058e85f5ee3ec6 (patch)
treeaad5408bb70db3f632060abc2701beb29a857ee7
parentb7097c101acaa579a8e23e8b3af6b3d489bc0b69 (diff)
sl#3321, au#1018: Pick up whatever Modem-Parameters are entered in "modemconfiguration" CP).
-rw-r--r--src/jarabe/model/network.py62
1 files changed, 32 insertions, 30 deletions
diff --git a/src/jarabe/model/network.py b/src/jarabe/model/network.py
index 84e3666..f66b620 100644
--- a/src/jarabe/model/network.py
+++ b/src/jarabe/model/network.py
@@ -938,37 +938,39 @@ def load_gsm_connection():
client = gconf.client_get_default()
- username = client.get_string(GSM_USERNAME_PATH) or ''
- password = client.get_string(GSM_PASSWORD_PATH) or ''
- number = client.get_string(GSM_NUMBER_PATH) or ''
- apn = client.get_string(GSM_APN_PATH) or ''
- pin = client.get_string(GSM_PIN_PATH) or ''
- puk = client.get_string(GSM_PUK_PATH) or ''
-
- if username and number and apn:
- settings = SettingsGsm()
- settings.gsm.username = username
- settings.gsm.number = number
- settings.gsm.apn = apn
-
- secrets = SecretsGsm()
- secrets.pin = pin
- secrets.puk = puk
- secrets.password = password
-
- settings.connection.id = 'gsm'
- settings.connection.type = NM_CONNECTION_TYPE_GSM
- uuid = settings.connection.uuid = unique_id()
- settings.connection.autoconnect = False
- settings.ip4_config.method = 'auto'
- settings.serial.baud = _BAUD_RATE
+ username = client.get_string(GSM_USERNAME_PATH) or None
+ password = client.get_string(GSM_PASSWORD_PATH) or None
+ number = client.get_string(GSM_NUMBER_PATH) or None
+ apn = client.get_string(GSM_APN_PATH) or None
+ pin = client.get_string(GSM_PIN_PATH) or None
+ puk = client.get_string(GSM_PUK_PATH) or None
+
+ logging.warning('Trying to establish 3G GSM connection. However,'
+ ' the connection may fail due to invalid/missing'
+ ' parameters, with NetworkManager giving'
+ ' error-code. For more details, see'
+ ' "http://dev.laptop.org.au/issues/1018"')
+ settings = SettingsGsm()
+ settings.gsm.username = username
+ settings.gsm.number = number
+ settings.gsm.apn = apn
+
+ secrets = SecretsGsm()
+ secrets.pin = pin
+ secrets.puk = puk
+ secrets.password = password
+
+ settings.connection.id = 'gsm'
+ settings.connection.type = NM_CONNECTION_TYPE_GSM
+ uuid = settings.connection.uuid = unique_id()
+ settings.connection.autoconnect = False
+ settings.ip4_config.method = 'auto'
+ settings.serial.baud = _BAUD_RATE
- try:
- add_connection(uuid, settings, secrets)
- except Exception:
- logging.exception('Error adding gsm connection to NMSettings.')
- else:
- logging.warning('No gsm connection was set in GConf.')
+ try:
+ add_connection(uuid, settings, secrets)
+ except Exception:
+ logging.exception('Error adding gsm connection to NMSettings.')
def load_connections():