def chkopts(opts):
    reg = re.compile("[^a-zA-Z0-9\./_:-]")

    if opts.name:
        if reg.search(opts.name):
            raise KssCommandOptException('ERROR: Illigal option value. option=%s value=%s' % ('-n or --name', opts.name))
    else:
        raise KssCommandOptException('ERROR: %s option is required.' % '-n or --name')

    if opts.type:
        if opts.type not in STORAGE_POOL_TYPE.values():
            raise KssCommandOptException('ERROR: Type is not available. type=%s' % opts.type)
    else:
        raise KssCommandOptException('ERROR: %s option is required.' % '-t or --type')

    if opts.type == STORAGE_POOL_TYPE["TYPE_DIR"]:
        # type:dir
        if not opts.target_path:
            raise KssCommandOptException('ERROR: %s option is required.' % '-p or --target_path')

    elif opts.type == STORAGE_POOL_TYPE["TYPE_ISCSI"]:
        # type:iscsi
        if not opts.host_name:
            raise KssCommandOptException('ERROR: %s option is required.' % '-b or --host_name')
        if not opts.device_path:
            raise KssCommandOptException('ERROR: %s option is required.' % '-d or --device_path')

    elif opts.type == STORAGE_POOL_TYPE["TYPE_FS"]:
        # type:fs
        if not opts.target_path:
            raise KssCommandOptException('ERROR: %s option is required.' % '-p or --target_path')
        if not opts.device_path:
            raise KssCommandOptException('ERROR: %s option is required.' % '-d or --device_path')

    else:
        raise KssCommandOptException('ERROR: The type that does not exist. type=%s' % opts.type)

    if opts.label:
        if reg.search(opts.label):
            raise KssCommandOptException('ERROR: Illigal option value. option=%s value=%s' % ('-l or --label', opts.label))

    reg = re.compile("[^0-9]")
    if opts.owner:
        if reg.search(opts.owner):
            if opts.owner not in [user[0] for user in get_pwd_info()]:
                raise KssCommandOptException('ERROR: Permission user not found. owner=%s' % (opts.owner))
        else:
            if int(opts.owner) not in [user[2] for user in get_pwd_info()]:
                raise KssCommandOptException('ERROR: Permission user not found. owner=%s' % (opts.owner))

    if opts.group:
        if reg.search(opts.group):
            if opts.group not in [group[0] for group in get_grp_info()]:
                raise KssCommandOptException('ERROR: Permission user not found. group=%s' % (opts.group))
        else:
            if [group[2] for group in get_grp_info()] not in int(opts.group):
                raise KssCommandOptException('ERROR: Permission user not found. group=%s' % (opts.group))

    reg = re.compile("^[0-9]{3,4}$")
    if opts.mode:
        if not reg.match(opts.mode):
            raise KssCommandOptException('ERROR: Illigal permission mode. mode=%s' % (opts.mode))
dataset/ETHPy150Open karesansui/karesansui/bin/create_storage_pool.py/chkopts/swapped operands of `not in`