MCPcopy Create free account
hub / github.com/apache/cloudstack / add_l2tp_ipsec_user

Method add_l2tp_ipsec_user

systemvm/debian/opt/cloud/bin/configure.py:1173–1186  ·  view source on GitHub ↗
(self, user, obj)

Source from the content-addressed store, hash-verified

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

Callers 1

processMethod · 0.95

Calls 6

searchStringMethod · 0.95
del_l2tp_ipsec_userMethod · 0.95
addMethod · 0.95
commitMethod · 0.95
CsFileClass · 0.90
debugMethod · 0.80

Tested by

no test coverage detected