Пример #1
0
#-------------------------------------------------
con.printBanner('nixAuth Automatic Package Installer', banner_color, banner_size)
if na_run_from:
    log.debug('naPkgInstall run from %s' %na_run_from)
    print 'Running from %s' %na_run_from

if not nixcommon.runningAsRoot():
    log.error('Exiting due to lack of root privileges')
    con.prints('This script must be run as root!  Exiting...')
    exit(-1)

# Find out which distro we're using and what version it's at then import it's config
distro_helper = None
try:
    log.debug('Loading the distro helper')
    distro_helper = distrodetermine.loadDistroHelper()
    con.printStatus('Distribution', '%s - %s (%s)' %(distro_helper.whoami, distro_helper.nickname,
                                                     distro_helper.version))
    log.info('Distro Info: %s - %s (%s)' %(distro_helper.whoami, distro_helper.nickname, distro_helper.version))
except distrodetermine.UnsupportedDistribution:
    error = 'I\'m sorry, this version of your distro is unsupported.  Please see the compatibility list at \
            http://www.nixauth.org/compatibility to find a distro that works with nixAuth.'
    log.error('Unsupported distribution detected, exiting.')
    con.printException(sys.exc_info(), error, exit_on_err = True, exit_value = 2)
except distrodetermine.DistributionImportError:
    error = 'I could not initialize the helper module for your distribution, the error is provided below:\n'
    log.error('Unable to initialize distro helper, exiting.')
    con.printException(sys.exc_info(), error, exit_on_err = True, exit_value = 3)

# Now to check to see if this version of the distro is supported
if not distro_helper.isSupported():
Пример #2
0
# Set up the console driver
log.debug('Setting up console driver')
con = console.Console(quiet_mode, color=color_mode)

if not nixcommon.runningAsRoot():
    log.info('Exiting due to lack of root privileges')
    con.prints('This script must be run as root!  Exiting...')
    exit(-1)


# If distro/version aren't passed, figure them out ourselves
if not distro_name or distro_version:
    log.debug('No distro info passed, using distrodetermine')
    from lib import distrodetermine
    distro_helper = distrodetermine.loadDistroHelper()
    distro_name = distro_helper.whoami
    distro_version = distro_helper.version

# Provide for hacks, let people specify the distro and version
else:
    log.debug('Distro info passed, skipping distrodetermine')
    distro_helper = distrodetermine.loadDistroHelper({'name':distro_name, 'version':distro_version})

log.info('Distro Info: %s - %s (%s)' %(distro_helper.whoami, distro_helper.nickname, distro_helper.version))

con.printBanner('nixAuth Path Builder', bannerColor, bannerSize)
if na_run_from:
    log.debug('PathBuilder run from %s' %na_run_from)
    print 'Running from %s' %na_run_from