Skip to content

Commit 78eef69

Browse files
committed
Fixed create_attribute_object signature in json module
Added missing promiser parameter to match the base class PromiseModule.create_attribute_object() signature. Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
1 parent 7f7930e commit 78eef69

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

promise-types/json/json_promise_type.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(self, **kwargs):
3939
self.types
4040
) # for now, the only valid attributes are the types.
4141

42-
def create_attribute_object(self, attributes):
42+
def create_attribute_object(self, promiser, attributes):
4343
data = {t: None for t in self.valid_attributes}
4444
for attr, val in attributes.items():
4545
data[attr] = val
@@ -73,7 +73,7 @@ def validate_promise(self, promiser, attributes, metadata):
7373
if colon and not field:
7474
raise ValidationError("Invalid syntax: field specified but empty")
7575

76-
model = self.create_attribute_object(attributes)
76+
model = self.create_attribute_object(promiser, attributes)
7777
if (
7878
model.object
7979
and isinstance(model.object, str)
@@ -113,7 +113,7 @@ def validate_promise(self, promiser, attributes, metadata):
113113
)
114114

115115
def evaluate_promise(self, promiser, attributes, metadata):
116-
model = self.create_attribute_object(attributes)
116+
model = self.create_attribute_object(promiser, attributes)
117117
filename, _, field = promiser.partition(":")
118118

119119
if os.path.exists(filename) and not os.path.isfile(filename):

0 commit comments

Comments
 (0)