2019-04-04 14:06:18 +00:00
|
|
|
"""Standard definition."""
|
|
|
|
|
|
|
|
|
2019-04-02 14:34:03 +00:00
|
|
|
class Standard(object):
|
|
|
|
"""
|
|
|
|
Standard definition for all defined rules.
|
|
|
|
|
|
|
|
Later lookup the config file for a path to a rules directory
|
|
|
|
or fallback to default `ansiblelater/data/*`.
|
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self, standard_dict):
|
|
|
|
"""
|
|
|
|
Initialize a new standard object and returns None.
|
|
|
|
|
|
|
|
:param standard_dict: Dictionary object containing all neseccary attributes
|
|
|
|
|
|
|
|
"""
|
2019-04-03 15:42:46 +00:00
|
|
|
self.id = standard_dict.get("id", "")
|
2019-04-02 14:34:03 +00:00
|
|
|
self.name = standard_dict.get("name")
|
|
|
|
self.version = standard_dict.get("version")
|
|
|
|
self.check = standard_dict.get("check")
|
|
|
|
self.types = standard_dict.get("types")
|
|
|
|
|
2020-04-05 12:33:43 +00:00
|
|
|
def __repr__(self): # noqa
|
2020-04-11 14:20:41 +00:00
|
|
|
return "Standard: {name} (version: {version}, types: {types})".format(
|
|
|
|
name=self.name, version=self.version, types=self.types
|
|
|
|
)
|