pyinfra.api.state module¶
-
class
pyinfra.api.state.
BaseStateCallback
¶ Bases:
object
-
static
host_before_connect
(state, host)¶
-
static
host_connect
(state, host)¶
-
static
host_connect_error
(state, host, error)¶
-
static
host_disconnect
(state, host)¶
-
static
operation_end
(state, op_hash)¶
-
static
operation_host_error
(state, host, op_hash)¶
-
static
operation_host_start
(state, host, op_hash)¶
-
static
operation_host_success
(state, host, op_hash)¶
-
static
operation_start
(state, op_hash)¶
-
static
-
class
pyinfra.api.state.
State
(inventory=None, config=None, **kwargs)¶ Bases:
object
Manages state for a pyinfra deploy.
-
activate_host
(host)¶ Flag a host as active.
-
add_callback_handler
(handler)¶
-
config
= None¶
-
current_deploy_filename
= None¶
-
current_exec_filename
= None¶
-
current_op_file_number
= 0¶
-
cwd
= None¶
-
fail_hosts
(hosts_to_fail, activated_count=None)¶ Flag a
set
of hosts as failed, error forconfig.FAIL_PERCENT
.
-
get_op_data
(host, op_hash)¶
-
get_op_meta
(op_hash)¶
-
get_op_order
()¶
-
get_temp_filename
(hash_key=None, hash_filename=True)¶ Generate a temporary filename for this deploy.
-
init
(inventory, config, initial_limit=None)¶
-
initialised
= False¶
-
inventory
= None¶
-
is_executing
= False¶
-
is_host_in_limit
(host)¶ Returns a boolean indicating if the host is within the current state limit.
-
loop_counter
= None¶
-
loop_filename
= None¶
-
loop_line
= None¶
-
pool
= None¶
-
preserve_loop_order
(items)¶
-
print_fact_info
= False¶
-
print_fact_input
= False¶
-
print_fact_output
= False¶
-
print_input
= False¶
-
print_noop_info
= False¶
-
print_output
= False¶
-
set_op_data
(host, op_hash, op_data)¶
-
to_dict
()¶
-
trigger_callbacks
(method_name, *args, **kwargs)¶
-