diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator index c0e0cc66..d436bbb3 100755 --- a/src/sbin/livemedia-creator +++ b/src/sbin/livemedia-creator @@ -964,22 +964,6 @@ def setup_logging(opts): log.setLevel(logging.DEBUG) pylorax_log.setLevel(logging.DEBUG) - -def default_image_name(compression, basename): - """ Return a default image name with the correct suffix for the compression type. - - :param str compression: Compression type - :param str basename: Base filename - :returns: basename with compression suffix - - If the compression is unknown it defaults to xz - """ - SUFFIXES = {"xz": ".xz", "gzip": ".gz", "bzip2": ".bz2", "lzma": ".lzma"} - return basename + SUFFIXES.get(compression, ".xz") - - -def main(): - sh = logging.StreamHandler() sh.setLevel(logging.INFO) fmt = logging.Formatter("%(asctime)s: %(message)s") @@ -1002,6 +986,19 @@ def main(): program_log.addHandler(fh) +def default_image_name(compression, basename): + """ Return a default image name with the correct suffix for the compression type. + + :param str compression: Compression type + :param str basename: Base filename + :returns: basename with compression suffix + + If the compression is unknown it defaults to xz + """ + SUFFIXES = {"xz": ".xz", "gzip": ".gz", "bzip2": ".bz2", "lzma": ".lzma"} + return basename + SUFFIXES.get(compression, ".xz") + + if __name__ == '__main__': parser = argparse.ArgumentParser( description="Create Live Install Media", fromfile_prefix_chars="@" )