Skip to content

Commit

Permalink
make all datasources and recipients strict
Browse files Browse the repository at this point in the history
  • Loading branch information
lausser committed Feb 16, 2024
1 parent 9cdb7ca commit aaea250
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* 2024-02-16 10.2.1.2
make all datasources and recipients strict
* 2024-02-16 10.2.1.1
check type of datarecipient_prometheus_snmp strict
* 2024-02-16 10.2.1
Expand Down
2 changes: 1 addition & 1 deletion recipes/default/classes/datarecipient_coshsh_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
logger = logging.getLogger('coshsh')

def __dr_ident__(params={}):
if coshsh.util.compare_attr("type", params, "datarecipient_coshsh_default"):
if coshsh.util.compare_attr("type", params, "^datarecipient_coshsh_default$"):
return DatarecipientCoshshDefault


Expand Down
2 changes: 1 addition & 1 deletion recipes/default/classes/datarecipient_discard.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


def __dr_ident__(params={}):
if compare_attr("type", params, "discard"):
if compare_attr("type", params, "^discard$"):
return DrDiscard


Expand Down
4 changes: 2 additions & 2 deletions recipes/default/classes/datasource_csvfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
logger = logging.getLogger('coshsh')

def __ds_ident__(params={}):
if coshsh.util.compare_attr("type", params, "recipe_csv"):
if coshsh.util.compare_attr("type", params, "^recipe_csv$"):
# csv-files have names like self.name+'_'+self.recipe_name+'_*.csv
# recommendation is to use CsvFile and add a coshsh_filter column
return CsvFileRecipe
if coshsh.util.compare_attr("type", params, "csv"):
if coshsh.util.compare_attr("type", params, "^csv$"):
return CsvFile

class CommentedFile:
Expand Down
2 changes: 1 addition & 1 deletion recipes/default/classes/datasource_discard.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


def __ds_ident__(params={}):
if coshsh.util.compare_attr("type", params, "discard"):
if coshsh.util.compare_attr("type", params, "^discard$"):
return DsDiscard


Expand Down
2 changes: 1 addition & 1 deletion recipes/default/classes/datasource_simplesample.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
logger = logging.getLogger('coshsh')

def __ds_ident__(params={}):
if coshsh.util.compare_attr("type", params, "simplesample"):
if coshsh.util.compare_attr("type", params, "^simplesample$"):
return SimpleSample


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def run(self):


setup(name='coshsh',
version='10.2.1.1',
version='10.2.1.2',
setup_requires=['wheel'],
description='Coshsh - config generator for monitoring systems',
long_description=open('README.md').read(),
Expand Down

0 comments on commit aaea250

Please sign in to comment.