def docker_action(tgt_name, keyfile, image, **kwargs): def on_action(): import setup_container res = bool(setup_container.find_container(tgt_name, search_all=True)) if not res: setup_container.setup(tgt_name, keyfile, image, **kwargs) source = "dvsdk_sshpass" global sshpass_installed if not sshpass_installed: apt_action(source, "sshpass") sshpass_installed = True disvolvu.append_edge(tgt_name, [source], action=on_action)
def ansible_action(tgt_name, sources, module_name, **kwargs): def on_action(): return ansible_action_impl(module_name, **kwargs) disvolvu.append_edge(tgt_name, sources=sources, action=on_action)