def create_setting(ns, caption, device, type, ipv4method, ipv6method):
    capability = device.first_associator(ResultClass="LMI_IPNetworkConnectionCapabilities",
                                         AssocClass="LMI_IPNetworkConnectionElementCapabilities")
    result = capability.LMI_CreateIPSetting(Caption=caption,
                                            Type=type,
                                            IPv4Type=ipv4method,
                                            IPv6Type=ipv6method)
    if result.rval != 0:
        raise LmiFailed("Unable to create setting: %s" % result.errorstr)
    LOG().info("Setting %s created", caption)
    return 0
Helper function for parsing BCache's SysFS interface
dataset/ETHPy150Open openlmi/openlmi-scripts/commands/networking/lmi/scripts/networking/__init__.py/create_setting--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/bcache.py/_sysfs_parse