Exemplo n.º 1
0
    def main(conninfo, credentials, args):
        user_id = users.get_user_id(conninfo, credentials, args.id)

        if args.password is not None:
            password = args.password
        else:
            password = \
                qumulo.lib.opts.read_password("New password for %s: " % args.id)

        users.set_user_password(conninfo, credentials, user_id.data, password)
        print "Changed password for %s" % args.id
Exemplo n.º 2
0
    def main(conninfo, credentials, args):
        if args.password is True:
            password = qumulo.lib.opts.read_password(args.name)
        elif args.password is not None:
            password = args.password

        group_id = groups.get_id(conninfo, credentials, args.primary_group)

        res = users.add_user(conninfo, credentials, args.name,
            group_id.data, args.uid)
        print res

        # Set new user's password, ignoring output.
        if args.password is not None:
            user_id = int(res.lookup('id'))
            users.set_user_password(conninfo, credentials, user_id,
                password)
Exemplo n.º 3
0
    def main(conninfo, credentials, args):
        if args.password is True:
            password = qumulo.lib.opts.read_password(args.name)
        elif args.password is not None:
            password = args.password

        group_id = groups.get_group_id(conninfo, credentials,
                                       args.primary_group)

        res = users.add_user(conninfo, credentials, args.name, group_id.data,
                             args.uid, args.home_directory)

        # Set new user's password, ignoring output.
        if args.password is not None:
            user_id = int(res.lookup('id'))
            users.set_user_password(conninfo, credentials, user_id, password)

        # Get all related IDs
        related_info_msg = get_expanded_identity_information_for_user(
            conninfo, credentials, int(res.lookup('id')))

        print res
        print related_info_msg