Skip to content
Snippets Groups Projects
Commit ba84d421 authored by Stefan Froehlich's avatar Stefan Froehlich
Browse files

Task #9058 Generic Pipeline: fix regarding the order of parset keys. now using...

Task #9058 Generic Pipeline: fix regarding the order of parset keys. now using a function that parses the parset (removing comments) while keeping the order of the original parset.
parent cdb3c43d
Branches
Tags
No related merge requests found
...@@ -260,7 +260,7 @@ class GenericPipeline(control): ...@@ -260,7 +260,7 @@ class GenericPipeline(control):
if 'pipeline.pluginpath' in subpipeline_parset.keywords(): if 'pipeline.pluginpath' in subpipeline_parset.keywords():
subpipeline_parset.remove('pipeline.pluginpath') subpipeline_parset.remove('pipeline.pluginpath')
checklist = copy.deepcopy(subpipeline_steplist) checklist = copy.deepcopy(subpipeline_steplist)
for k in subpipeline_parset.keywords(): for k in self._keys(subpipeline_parset):
if 'loopsteps' in k: if 'loopsteps' in k:
for item in subpipeline_parset.getStringVector(k): for item in subpipeline_parset.getStringVector(k):
checklist.append(item) checklist.append(item)
...@@ -274,7 +274,7 @@ class GenericPipeline(control): ...@@ -274,7 +274,7 @@ class GenericPipeline(control):
# replace names of steps with the subpipeline stepname to create a unique identifier. # replace names of steps with the subpipeline stepname to create a unique identifier.
# replacement values starting with ! will be taken from the master parset and overwrite # replacement values starting with ! will be taken from the master parset and overwrite
# the ones in the subpipeline. only works if the ! value is already in the subpipeline # the ones in the subpipeline. only works if the ! value is already in the subpipeline
for k in subpipeline_parset.keywords(): for k in self._keys(subpipeline_parset):
val = subpipeline_parset[k] val = subpipeline_parset[k]
if not str(k).startswith('!') and not str(k).startswith('pipeline.replace.'): if not str(k).startswith('!') and not str(k).startswith('pipeline.replace.'):
for item in checklist: for item in checklist:
...@@ -287,7 +287,7 @@ class GenericPipeline(control): ...@@ -287,7 +287,7 @@ class GenericPipeline(control):
for i, item in enumerate(subpipeline_steplist): for i, item in enumerate(subpipeline_steplist):
subpipeline_steplist[i] = stepname + '-' + item subpipeline_steplist[i] = stepname + '-' + item
for item in step_parset_obj[stepname].keys(): for item in step_parset_obj[stepname].keys():
for k in self.parset.keywords(): for k in self._keys(self.parset):
if str(k).startswith('!') and item in k or str(k).startswith('pipeline.replace.') and item in k: if str(k).startswith('!') and item in k or str(k).startswith('pipeline.replace.') and item in k:
self.parset.remove(k) self.parset.remove(k)
self.parset.add('! ' + item, str(step_parset_obj[stepname][item])) self.parset.add('! ' + item, str(step_parset_obj[stepname][item]))
...@@ -465,7 +465,7 @@ class GenericPipeline(control): ...@@ -465,7 +465,7 @@ class GenericPipeline(control):
tmp_keys = argsparset.keys() tmp_keys = argsparset.keys()
ordered_keys = [] ordered_keys = []
parsetdict = {} parsetdict = {}
for orig in self.parset.keywords(): for orig in self._keys(self.parset):
for item in tmp_keys: for item in tmp_keys:
if (stepname + '.') in orig and ('argument.'+item in orig and not 'argument.'+item+'.' in orig): if (stepname + '.') in orig and ('argument.'+item in orig and not 'argument.'+item+'.' in orig):
ordered_keys.append(item) ordered_keys.append(item)
...@@ -483,6 +483,14 @@ class GenericPipeline(control): ...@@ -483,6 +483,14 @@ class GenericPipeline(control):
return additional return additional
#inoutdict.update(additional) #inoutdict.update(additional)
def _keys(self, inparset):
outlist = []
for k in inparset.keys:
for l in inparset.keywords():
if k == l:
outlist.append(l)
return outlist
def _get_parset_dicts(self): def _get_parset_dicts(self):
return {} return {}
...@@ -506,13 +514,14 @@ class GenericPipeline(control): ...@@ -506,13 +514,14 @@ class GenericPipeline(control):
def _replace_values(self): def _replace_values(self):
replacedict = OrderedDict() replacedict = OrderedDict()
for check in self.parset.keywords(): for check in self._keys(self.parset):
if str(check).startswith('!'): if str(check).startswith('!'):
replacedict[str(check).lstrip('!').lstrip(' ')] = str(self.parset[check]) replacedict[str(check).lstrip('!').lstrip(' ')] = str(self.parset[check])
if str(check).startswith('pipeline.replace.'): if str(check).startswith('pipeline.replace.'):
replacedict[str(check).replace('pipeline.replace.', '').lstrip(' ')] = str(self.parset[check]) replacedict[str(check).replace('pipeline.replace.', '').lstrip(' ')] = str(self.parset[check])
#print 'REPLACEDICT: ',replacedict #self.logger.info( 'REPLACEDICT: ')
for check in self.parset.keywords(): #self.logger.info(replacedict)
for check in self._keys(self.parset):
for k, v in reversed(replacedict.items()): for k, v in reversed(replacedict.items()):
if '{{ '+k+' }}' in str(self.parset[check]): if '{{ '+k+' }}' in str(self.parset[check]):
replacestring = str(self.parset[check]).replace('{{ '+k+' }}',v) replacestring = str(self.parset[check]).replace('{{ '+k+' }}',v)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment