The extra blank line leads me to believe our script is inserting a \n (which is apparently part of an empty string) as the MAC address. Now, NetworkManager on Precise seems to dislike the empty mac-address attribute, and so the connection gets ignored. If I remove the mac-address line altogether, the connection becomes visible in nmcli con list and can be enabled with nmcli con up.
So we'd need to either fill in the mac address (if it can be obtained somehow), or skip that line altogether. Bottom line, Network Manager in Precise doesn't like empty attributes :)
OK, I figured out the problem here.
This is the 802-11-wireless section for the NM-generated connection file:
[802-11-wireless] cert-n- wpa 00:26:B6: DC:46:73 802-11- wireless- security
ssid=ubuntu-
mode=infrastructure
mac-address=
security=
This is the same section for the connection file generated by create_connection:
[802-11-wireless] cert-bg- wpa
ssid=ubuntu-
mode=infrastructure
mac-address=
security= 802-11- wireless- security
The extra blank line leads me to believe our script is inserting a \n (which is apparently part of an empty string) as the MAC address. Now, NetworkManager on Precise seems to dislike the empty mac-address attribute, and so the connection gets ignored. If I remove the mac-address line altogether, the connection becomes visible in nmcli con list and can be enabled with nmcli con up.
So we'd need to either fill in the mac address (if it can be obtained somehow), or skip that line altogether. Bottom line, Network Manager in Precise doesn't like empty attributes :)
Setting as Triaged with importance: Medium.