pyinfra.api.state module¶
-
class
pyinfra.api.state.BaseStateCallback¶ Bases:
object
-
class
pyinfra.api.state.State(inventory: Inventory | None = None, config: Config | None = None, **kwargs)¶ Bases:
objectManages state for a pyinfra deploy.
-
add_callback_handler(handler)¶
-
current_deploy_filename: str | None = None¶
-
current_exec_filename: str | None = None¶
-
current_op_file_number: int = 0¶
-
cwd: str | None = None¶
-
fail_hosts(hosts_to_fail, activated_count=None)¶ Flag a
setof hosts as failed, error forconfig.FAIL_PERCENT.
-
get_op_meta(op_hash: str)¶
-
get_op_order()¶
-
get_temp_filename(hash_key: str | None = None, hash_filename: bool = True)¶ Generate a temporary filename for this deploy.
-
initialised: bool = False¶
-
is_executing: bool = False¶
-
is_host_in_limit(host: Host)¶ Returns a boolean indicating if the host is within the current state limit.
-
pool: Pool¶
-
preserve_loop_order(items)¶
-
print_fact_info: bool = False¶
-
print_fact_input: bool = False¶
-
print_fact_output: bool = False¶
-
print_input: bool = False¶
-
print_noop_info: bool = False¶
-
print_output: bool = False¶
-
to_dict()¶
-
trigger_callbacks(method_name: str, *args, **kwargs)¶
-
pyinfra 2.x