1 ##############################################################################
2 # Copyright 2017 Parker Berberian and Others #
4 # Licensed under the Apache License, Version 2.0 (the "License"); #
5 # you may not use this file except in compliance with the License. #
6 # You may obtain a copy of the License at #
8 # http://www.apache.org/licenses/LICENSE-2.0 #
10 # Unless required by applicable law or agreed to in writing, software #
11 # distributed under the License is distributed on an "AS IS" BASIS, #
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
13 # See the License for the specific language governing permissions and #
14 # limitations under the License. #
15 ##############################################################################
18 from vpnAction import VPNAction
21 class Del_VPN_User(VPNAction):
23 def __init__(self, config=None):
24 super(Del_VPN_User, self).__init__(config=config)
26 def run(self, dn=None, key=None):
27 if not dn or dn == "None":
28 if not key or key == "None":
30 vpn_info = json.loads(
31 self.action_service.get_value(
41 # get username from dn
42 for attr in dn.split(','):
44 st2key += attr.split('=')[-1]
45 # we have the dn and key now
46 self.action_service.delete_value(name=st2key, local=False)