usually there is a colon after the space  rather than creating a temporary object  you could certainly just write this as self wlans append  type wifi mode managed autoconnect true ssid wlan ssid security wlan security passphrase wlan passphrase 