The apmec.agent.linux.utils Module

The apmec.agent.linux.utils Module

apmec.agent.linux.utils.create_process(cmd, root_helper=None, addl_env=None, debuglog=True)

Create a process object for the given command.

The return value will be a tuple of the process object and the list of command arguments used to create it.

apmec.agent.linux.utils.execute(cmd, root_helper=None, process_input=None, addl_env=None, check_exit_code=True, return_stderr=False, debuglog=True)
apmec.agent.linux.utils.find_child_pids(pid)

Retrieve a list of the pids of child processes of the given pid.

apmec.agent.linux.utils.get_interface_mac(interface)
apmec.agent.linux.utils.replace_file(file_name, data)

Replaces the contents of file_name with data in a safe manner.

First write to a temp file and then rename. Since POSIX renames are atomic, the file is unlikely to be corrupted by competing writes.

We create the tempfile on the same device to ensure that it can be renamed.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.