Skip to content

Commit 10a7ea8

Browse files
committed
Fix fact hash for short facts where the backing fact takes arguments
1 parent 7f4b8cc commit 10a7ea8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pyinfra/api/facts.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ def get_fact(
197197
args=args,
198198
kwargs=kwargs,
199199
ensure_hosts=ensure_hosts,
200+
apply_failed_hosts=apply_failed_hosts,
201+
fact_hash=fact_hash,
202+
use_cache=use_cache,
200203
)
201204

202205
with host.facts_lock:
@@ -336,6 +339,8 @@ def _get_fact(
336339

337340

338341
def _get_fact_hash(state: "State", host: "Host", cls, args, kwargs):
342+
if issubclass(cls, ShortFactBase):
343+
cls = cls.fact
339344
fact_kwargs, executor_kwargs = _handle_fact_kwargs(state, host, cls, args, kwargs)
340345
return make_hash((cls, fact_kwargs, executor_kwargs))
341346

0 commit comments

Comments
 (0)