Initial commit

This commit is contained in:
nd 2021-03-12 03:35:14 +01:00
commit 420be44f56
No known key found for this signature in database
GPG key ID: 21B5CD4DEE3670E9
11 changed files with 432 additions and 0 deletions

27
filter_plugins/filters.py Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env python3
import os
def filterEnabled(inputdict):
output = []
for i in inputdict.keys():
if inputdict.get(i):
output.append(i)
return output
def vmpath2hostpath(inputfiles, mountpoint):
output = []
for line in inputfiles:
line = os.path.normpath(line)
if line.startswith('/'):
disk = '*'
output.append(os.path.join(mountpoint, disk, line[1:]))
else:
output.append(line)
return output
class FilterModule(object):
def filters(self):
return {
'vmpath2hostpath': vmpath2hostpath,
'filterEnabled': filterEnabled,
}