コード例 #1
0
def main():
    issudo = "sudo "

    # check if user is sudoer
    if os.geteuid() == 0:
        print "Sorry, you are root. Please type: ./installer without sudo. Your password will be required later. Exit program\n"
        sys.exit(2)

    # Check input parameters
    try:
        opts, args = getopt.getopt(sys.argv[1:], 'ha')
    except getopt.GetoptError:
        usage()
    for opt, arg in opts:
        if opt == '-h':
            usage()
        elif opt in ('-a'):
            issudo = ""

    try:
        this_computer = Os()
    except UnsupportedOs, e:
        MsgUser.debug(str(e))
        raise InstallFailed(str(e))
コード例 #2
0
def main():
    issudo = "sudo "

    # check if user is sudoer
    if os.geteuid() == 0:
        print "Sorry, you are root. Please type: ./installer without sudo. Your password will be required later. Exit program\n"
        sys.exit(2)

    # Check input parameters
    try:
        opts, args = getopt.getopt(sys.argv[1:], 'ha')
    except getopt.GetoptError:
        usage()
    for opt, arg in opts:
        if opt == '-h':
            usage()
        elif opt in ('-a'):
            issudo = ""

    try:
        this_computer = Os()
    except UnsupportedOs, e:
        MsgUser.debug(str(e))
        raise InstallFailed(str(e))