def detect_platform(temp_dir): fetcher = Fetcher() os.chdir(temp_dir) path= fetcher.getResource("resources/probes.tar.gz", temp_dir+"/probes.tar.gz") print_console(PROGRAM+"Extracted probes to:"+path) untar(path,temp_dir) detector = PlatformDetector(temp_dir+"/probes/") platform=detector.detect_platform() print_console(PROGRAM+"Detected platform as: "+platform) ARGS.platform=platform return platform
def detect_platform(temp_dir): cwd = os.getcwd() fetcher = Fetcher() os.chdir(temp_dir) path= fetcher.getResource("resources/probes.tar.gz", temp_dir+"/probes.tar.gz") info("Extracted probes to:"+path) untar(path,temp_dir) detector = PlatformDetector(temp_dir+"/probes/") platform=detector.detect_platform() info("Detected platform as: "+platform) shutil.rmtree(temp_dir,ignore_errors=True) os.chdir(cwd) return platform