|
|
|
|
191
|
|
191
|
|
192
|
def create_client(self, vpn_name, client_name, variables):
|
192
|
def create_client(self, vpn_name, client_name, variables):
|
193
|
base_dir = self.get_base_dir(vpn_name)
|
193
|
base_dir = self.get_base_dir(vpn_name)
|
194
|
- client_conf_file = self.get_client_config_path(vpn_name, client_name)
|
|
|
195
|
if not os.path.exists(base_dir):
|
194
|
if not os.path.exists(base_dir):
|
196
|
return VpnGenError.VpnDoesNotExists
|
195
|
return VpnGenError.VpnDoesNotExists
|
197
|
client_dir = self.get_client_dir(vpn_name, client_name)
|
196
|
client_dir = self.get_client_dir(vpn_name, client_name)
|
|
|
|
|
254
|
files_names = glob.glob("%s%s*" % (client_dir, os.sep))
|
253
|
files_names = glob.glob("%s%s*" % (client_dir, os.sep))
|
255
|
files_names = list(map(lambda file_path: os.path.basename(file_path), files_names))
|
254
|
files_names = list(map(lambda file_path: os.path.basename(file_path), files_names))
|
256
|
|
255
|
|
257
|
- print(files_names)
|
|
|
258
|
-
|
|
|
259
|
call(["tar", "cfj", self.get_client_tarball_path(vpn_name, client_name),
|
256
|
call(["tar", "cfj", self.get_client_tarball_path(vpn_name, client_name),
|
260
|
"-C", client_dir] + files_names)
|
257
|
"-C", client_dir] + files_names)
|