#!/usr/bin/python3.11
"""
Wrapper for cobbler
"""

# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: Copyright 2006-2009, Red Hat, Inc and Others
# SPDX-FileCopyrightText: Michael DeHaan <michael.dehaan AT gmail>

import sys

import cobbler.cli as app

PROFILING = False

if PROFILING:
    print("** PROFILING **")
    import hotshot
    import hotshot.stats

    prof = hotshot.Profile("cobbler.prof")
    prof.runcall(app.main)
    prof.close()
    stats = hotshot.stats.load("cobbler.prof")
    stats.strip_dirs()
    stats.sort_stats("time")
    print("** REPORT **")
    stats.print_stats(100)
    sys.exit(0)
else:
    sys.exit(app.main())
