#!/usr/bin/python
from os import walk
from shutil import rmtree

wl = [
    'ShootExec',
    'InfluxUploader',
    'Telegraf',
    'OfflineReport',
    'Autostop',
    'Platform',
    'JMeter',
    'CloudUploader',
    'NeUploader',
    'Pandora',
    'Android',
    'ResourceCheck',
    'Bfg',
    'OpenTSDBUploader',
    'RCAssert',
    'ShellExec',
    'JsonReport',
    'DataUploader',
    'Phantom',
    'Console'
]

for (dirpath, dirnames, filenames) in walk('yandextank/plugins'):
    for dirname in dirnames:
        if not dirname in wl:
            rmtree('yandextank/plugins/' + dirname)
            print('yandextank/plugins/' + dirname + ' removed')
    break
