Currently, util contains many things in one file, often unrelated.
A util folder could be created grouping command in logical chunks (command operation, file operation, ...)
process.py:
def popen(command, flag='', shell=None, input=None, timeout=None, env=None, def run(command, flag='', shell=None, input=None, timeout=None, env=None, def cmd(command, flag='', shell=None, input=None, timeout=None, env=None, def call(command, flag='', shell=None, input=None, timeout=None, env=None, def process_running(pid_file): def process_named_running(name): def get_half_cpus():
file.py:
def read_file(fname, defaultonfailure=None): def read_json(fname, defaultonfailure=None): def chown(path, user, group): def chmod(path, bitmask): def chmod_600(path): def chmod_750(path): def chmod_755(path): def makedir(path, user=None, group=None): def file_is_persistent(path):
commit.py:
def commit_in_progress(): def wait_for_commit_lock():
interface.py (perhaps should be moved within interface):
def get_bridge_member_config(conf, br, intf): def ifname_from_config(conf): def mac2eui64(mac, prefix=None):
rights.py:
def is_admin() -> bool: def get_cfg_group_id():
various.py:
def seconds_to_human(s, separator=""): def ask_yes_no(question, default=False) -> bool: def colon_separated_to_dict(data_string, uniquekeys=False):