def get_all_osvariants(): cmd = ["osinfo-query", "os", "-f", "short-id"] c.debug("Executing: {}".format(" ".join(cmd))) try: out = subprocess.check_output(cmd) except: print(c.RED("Error executing osinfo-query; install libosinfo rpm\n")) raise allVariants = ["auto"] for line in out.splitlines()[2:]: allVariants.append(line.strip()) return allVariants
def get_all_osvariants(): cmd = ['osinfo-query', 'os', '-f', 'short-id'] c.debug("Executing: {}".format(" ".join(cmd))) try: out = subprocess.check_output(cmd) except: print(c.RED("Error executing osinfo-query; install libosinfo rpm\n")) raise allVariants = ['auto'] for line in out.splitlines()[2:]: allVariants.append(line.strip().decode('utf-8')) return allVariants
def build_initial_cache(): if os.path.isdir(cfg.tabCacheDir): return c.debug("Building initial cache") refresh_cache()
def update_cache_file(outfile, input): outfile = "{}/{}".format(cfg.tabCacheDir, outfile) c.debug("Updating cache file {}".format(outfile)) with open(outfile, "w") as f: json.dump(input, f)
def update_cache_file(outfile, input): outfile = "{}/{}".format(cfg.tabCacheDir, outfile) c.debug("Updating cache file {}".format(outfile)) with open(outfile, 'w') as f: json.dump(input, f)