subiquity/bin/subiquity

50 lines
1.6 KiB
Python
Executable File

#!/usr/bin/env python3
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import argparse
import sys
import logging
from subiquity.log import setup_logger
from subiquity import __version__ as VERSION
from subiquity.controllers import BaseController as Subiquity
from subiquity.ui.frame import SubiquityUI
def parse_options(argv):
parser = argparse.ArgumentParser(
description='SUbiquity - Ubiquity for Servers',
prog='subiquity')
parser.add_argument('--serial', action='store_true',
dest='run_on_serial',
help='Run the installer over serial console.')
return parser.parse_args(argv)
def main():
opts = parse_options(sys.argv[1:])
setup_logger()
logger = logging.getLogger('subiquity')
logger.info("Starting SUbiquity v{}".format(VERSION))
logger.info("Arguments passed: {}".format(sys.argv))
ui = SubiquityUI()
subiquity_interface = Subiquity(ui, opts)
subiquity_interface.run()
if __name__ == '__main__':
main()