(self, user, obj)
| 1171 | self.del_l2tp_ipsec_user(user, userconfig) |
| 1172 | |
| 1173 | def add_l2tp_ipsec_user(self, user, obj): |
| 1174 | userfound = False |
| 1175 | password = obj['password'] |
| 1176 | |
| 1177 | userAddEntry = "%s * %s *" % (user, password) |
| 1178 | logging.debug("Adding vpn user '%s'" % user) |
| 1179 | |
| 1180 | file = CsFile(self.PPP_CHAP) |
| 1181 | userfound = file.searchString(userAddEntry, '#') |
| 1182 | if not userfound: |
| 1183 | logging.debug("User is not there already, so adding user") |
| 1184 | self.del_l2tp_ipsec_user(user, obj) |
| 1185 | file.add(userAddEntry) |
| 1186 | file.commit() |
| 1187 | |
| 1188 | def del_l2tp_ipsec_user(self, user, obj): |
| 1189 | userfound = False |
no test coverage detected