Initial commit
This commit is contained in:
commit
420be44f56
11 changed files with 432 additions and 0 deletions
27
filter_plugins/filters.py
Executable file
27
filter_plugins/filters.py
Executable 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,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue