def infrasim_init(node_type="dell_r730", skip_installation=True, force=False, config_file=None, entry=None): if check_existing_workspace(): if not force: raise WorkspaceExisting("There is node workspace existing.\n" "If you want to remove it, please run:\n" "\"infrasim init -f \"") if force: destroy_existing_nodes() create_infrasim_directories() if not skip_installation: install_all_packages(force, entry) config_library_link() update_bridge_cfg() if config_file: if os.path.exists(config_file): shutil.copy2(config_file, config.infrasim_etc) else: raise Exception("{} not found.".format(config_file)) else: init_infrasim_conf(node_type) # record infrasim environment get_environment() get_socat() get_ipmi() get_qemu()
def infrasim_init(node_type="dell_r730", skip_installation=True, force=False, target_home=None, config_file=None): if check_existing_workspace(): if not force: raise WorkspaceExisting("There is node workspace existing.\n" "If you want to remove it, please run:\n" "\"infrasim init -f \"") if force: destroy_existing_nodes() create_infrasim_directories() if not skip_installation: install_packages() config_library_link() update_bridge_cfg() if config_file: if os.path.exists(config_file): shutil.copy2(config_file, config.infrasim_etc) else: raise Exception("{} not found.".format(config_file)) else: init_infrasim_conf(node_type) # record infrasim environment get_environment() get_socat() get_ipmi() get_qemu()
def infrasim_init(node_type="quanta_d51", skip_installation=False, target_home=None, config_file=None): try: create_infrasim_directories() if not skip_installation: install_packages() update_bridge_cfg() config_library_link() if config_file: if os.path.exists(config_file): shutil.copy2(config_file, config.infrasim_etc) else: raise Exception("{} not found.".format(config_file)) else: init_infrasim_conf(node_type) get_socat() get_ipmi() get_qemu() print "Infrasim init OK" except CommandNotFound as e: print "command:{} not found\n" \ "Infrasim init failed".format(e.value) except CommandRunFailed as e: print "command:{} run failed\n" \ "Infrasim init failed".format(e.value)
def test_ipmi_exist(): try: ipmi.get_ipmi() assert True except: assert False