MCPcopy
hub / github.com/apache/caldera / update

Method update

app/utility/base_object.py:29–39  ·  view source on GitHub ↗

Updates the given field to the given value as long as the value is not None and the new value is different from the current value. Ignoring None prevents current property values from being overwritten to None if the given property is not intentionally passed back to be updat

(self, field, value)

Source from the content-addressed store, hash-verified

27 return self
28
29 def update(self, field, value):
30 """
31 Updates the given field to the given value as long as the value is not None and the new value is different from
32 the current value. Ignoring None prevents current property values from being overwritten to None if the given
33 property is not intentionally passed back to be updated (example: Agent heartbeat)
34
35 :param field: object property to update
36 :param value: value to update to
37 """
38 if (value is not None) and (value != self.__getattribute__(field)):
39 self.__setattr__(field, value)
40
41 def search_tags(self, value):
42 tags = getattr(self, 'tags', None)

Callers 15

storeMethod · 0.80
gui_modificationMethod · 0.80
killMethod · 0.80
storeMethod · 0.80
__init__Method · 0.80
storeMethod · 0.80
storeMethod · 0.80
storeMethod · 0.80
storeMethod · 0.80
storeMethod · 0.80
storeMethod · 0.80

Calls

no outgoing calls

Tested by 12

test_update_booleanMethod · 0.64
storeMethod · 0.64
combined_configFunction · 0.64
replaced_source_payloadFunction · 0.64
updated_plannerFunction · 0.64
updated_ability_payloadFunction · 0.64
replaced_ability_payloadFunction · 0.64