ironic_python_agent.extensions.base.
AgentCommandStatus
[source]¶Bases: object
Mapping of agent command statuses.
FAILED
= 'FAILED'¶RUNNING
= 'RUNNING'¶SUCCEEDED
= 'SUCCEEDED'¶VERSION_MISMATCH
= 'CLEAN_VERSION_MISMATCH'¶ironic_python_agent.extensions.base.
AsyncCommandResult
(command_name, command_params, execute_method, agent=None)[source]¶Bases: ironic_python_agent.extensions.base.BaseCommandResult
A command that executes asynchronously in the background.
is_done
()[source]¶Checks to see if command is still RUNNING.
True if command is done, False if still RUNNING
join
(timeout=None)[source]¶Block until command has completed, and return result.
timeout – float indicating max seconds to wait for command to complete. Defaults to None.
ironic_python_agent.extensions.base.
BaseCommandResult
(command_name, command_params)[source]¶Bases: ironic_python_agent.encoding.SerializableComparable
Base class for command result.
is_done
()[source]¶Checks to see if command is still RUNNING.
True if command is done, False if still RUNNING
serializable_fields
= ('id', 'command_name', 'command_params', 'command_status', 'command_error', 'command_result')¶ironic_python_agent.extensions.base.
SyncCommandResult
(command_name, command_params, success, result_or_error)[source]¶Bases: ironic_python_agent.extensions.base.BaseCommandResult
A result from a command that executes synchronously.
ironic_python_agent.extensions.base.
async_command
(command_name, validator=None)[source]¶Will run the command in an AsyncCommandResult in its own thread.
command_name is set based on the func name and command_params will be whatever args/kwargs you pass into the decorated command. Return values of type str or unicode are prefixed with the command_name parameter when returned for consistency.
ironic_python_agent.extensions.base.
sync_command
(command_name, validator=None)[source]¶Decorate a method to wrap its return value in a SyncCommandResult.
For consistency with @async_command() can also accept a validator which will be used to validate input, although a synchronous command can also choose to implement validation inline.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.