added back in wrongly deleted lines. Added checks to see if groups option exists for a section
@@ -168,8 +168,8 @@ def file_queue(path, template_path="/vent/"):
files = file_name
_, path = path.split('_', 1)
- # change
- labels = {'vent-plugin': '', 'file': path}
+ directory = path.rsplit('/', 1)[0]
+ path = path.replace('/files', files, 1)
# read in configuration of plugins to get the ones that should run
# against the path.
@@ -186,8 +186,7 @@ def file_queue(path, template_path="/vent/"):
link_name = config.get(section, 'link_name')
name_maps[link_name] = image_name.replace(':', '-').replace('/', '-')
# doesn't matter if it's a repository or registry because both in manifest
-
- ########
+ if config.has_option(section, 'groups'):
if 'replay' in config.get(section, 'groups'):
try:
# read the vent.cfg file to grab the network-mapping
@@ -206,8 +205,6 @@ def file_queue(path, template_path="/vent/"):
except Exception as e: # pragma: no cover
failed_images.add(image_name)
status = (False, str(e))
- ########
-
if config.has_option(section, 'service'):
try:
options_dict = json.loads(config.get(section, 'service'))
@@ -344,13 +341,18 @@ def file_queue(path, template_path="/vent/"):
'syslog-facility': 'daemon',
'tag': path.rsplit('.', 1)[-1]}}
+ special_bind = False
+ if config.has_option(section, 'groups'):
if 'replay' in config.get(section, 'groups'):
- dir_path = path.rsplit('/', 1)[0]
- volumes = {dir_path: {'bind': dir_path, 'mode': 'rw'}}
- else:
# replay_pcap is special so we can't bind it like normal
+ # since the plugin takes in an additional argument
dir_path = orig_path.rsplit('/', 1)[0]
volumes = {dir_path: {'bind': dir_path, 'mode': 'rw'}}
+ special_bind = True
+
+ if not special_bind:
+ dir_path = path.rsplit('/', 1)[0]
+ volumes = {dir_path: {'bind': dir_path, 'mode': 'rw'}}
# setup gpu queue
can_queue_gpu = True
