Module: Yast::MultipathOptionsInclude
- Defined in:
- ../../src/include/multipath/options.rb
Instance Method Summary (collapse)
-
- (Object) add_quotes(value)
add quotes to configuration value, no matter how many words.
- - (Object) alias_handler(item)
- - (Object) build_alias_term(opt)
- - (Object) build_combobox_list(opts)
- - (Object) build_devnode_term(opt)
- - (Object) build_failback_term(opt)
- - (Object) build_features_term(opt)
- - (Object) build_getuid_callout_term(opt)
- - (Object) build_hardware_handler_term(opt)
- - (Object) build_no_path_retry_term(opt)
- - (Object) build_path_checker_term(opt)
- - (Object) build_path_gp_term(opt)
- - (Object) build_path_selector_term(opt)
- - (Object) build_polling_interval_term(opt)
- - (Object) build_prio_callout_term(opt)
- - (Object) build_product_blacklist_term(opt)
- - (Object) build_product_term(opt)
- - (Object) build_rr_min_io_term(opt)
- - (Object) build_rr_weight_term(opt)
- - (Object) build_selector_term(opt)
- - (Object) build_udev_dir_term(opt)
- - (Object) build_user_friendly_names_term(opt)
- - (Object) build_valid_chars(key)
- - (Object) build_vendor_term(opt)
- - (Object) build_wwid_term(opt)
- - (Object) check_alias(item)
- - (Object) check_devnode(item)
- - (Object) check_failback(item)
- - (Object) check_features(item)
- - (Object) check_getuid_callout(item)
- - (Object) check_hardware_handler(item)
- - (Object) check_no_path_retry(item)
- - (Object) check_path_checker(item)
- - (Object) check_path_gp(item)
- - (Object) check_path_selector(item)
- - (Object) check_polling_interval(item)
- - (Object) check_prio_callout(item)
- - (Object) check_product(item)
- - (Object) check_product_blacklist(item)
- - (Object) check_rr_min_io(item)
- - (Object) check_rr_weight(item)
- - (Object) check_selector(item)
- - (Object) check_udev_dir(item)
- - (Object) check_user_friendly_names(item)
- - (Object) check_vendor(item)
- - (Object) check_wwid(item)
- - (Object) devnode_handler(item)
- - (Object) failback_handler(item)
- - (Object) features_handler(item)
-
- (Object) get_newid(items)
get a new id for new item, this will help to make each item unique.
- - (Object) getuid_callout_handler(item)
- - (Object) hardware_handler_handler(item)
- - (Object) initialize_multipath_options(include_target)
- - (Object) no_path_retry_handler(item)
- - (Object) path_checker_handler(item)
- - (Object) path_gp_handler(item)
- - (Object) path_selector_handler(item)
- - (Object) polling_interval_handler(item)
- - (Object) prio_callout_handler(item)
- - (Object) product_blacklist_handler(item)
- - (Object) product_handler(item)
-
- (Object) rm_quotes(value)
remove all the quotes at head and end.
- - (Object) rr_min_io_handler(item)
- - (Object) rr_weight_handler(item)
- - (Object) selector_handler(item)
- - (Object) udev_dir_handler(item)
- - (Object) update_alias_term(item)
- - (Object) update_devnode_term(item)
- - (Object) update_failback_term(item)
- - (Object) update_features_term(item)
- - (Object) update_getuid_callout_term(item)
- - (Object) update_hardware_handler_term(item)
- - (Object) update_no_path_retry_term(item)
- - (Object) update_path_checker_term(item)
- - (Object) update_path_gp_term(item)
- - (Object) update_path_selector_term(item)
- - (Object) update_polling_interval_term(item)
- - (Object) update_prio_callout_term(item)
- - (Object) update_product_blacklist_term(item)
- - (Object) update_product_term(item)
- - (Object) update_rr_min_io_term(item)
- - (Object) update_rr_weight_term(item)
- - (Object) update_selector_term(item)
- - (Object) update_udev_dir_term(item)
- - (Object) update_user_friendly_names_term(item)
- - (Object) update_vendor_term(item)
- - (Object) update_wwid_term(item)
- - (Object) user_friendly_names_handler(item)
- - (Object) vendor_handler(item)
- - (Object) wwid_handler(item)
Instance Method Details
- (Object) add_quotes(value)
add quotes to configuration value, no matter how many words. if the value has quotes pair, do not touch it. if more than 1 quote at the head or end, only keep one. if there are quote inside the value, ignore.
734 735 736 737 738 739 740 |
# File '../../src/include/multipath/options.rb', line 734 def add_quotes(value) result = rm_quotes(value) if Ops.greater_than(Builtins.size(result), 0) result = Ops.add(Ops.add("\"", result), "\"") end result end |
- (Object) alias_handler(item)
2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 |
# File '../../src/include/multipath/options.rb', line 2149 def alias_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:alias), :Value) if Ops.is_string?(ret) == true value = Convert.to_string(ret) else Popup.Message(Builtins.sformat("alias_handler: unexpected ret %1", ret)) end Ops.set(item, "alias", value) deep_copy(item) end |
- (Object) build_alias_term(opt)
2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 |
# File '../../src/include/multipath/options.rb', line 2127 def build_alias_term(opt) entry = Ops.get_map(@alias_opts, "entry", {}) ret = Empty() if entry != {} id = Ops.get_symbol(entry, "id", :id) label_str = Ops.get_string(entry, "name", "NA") ret = TextEntry(Id(id), Opt(:notify), label_str, "") else Popup.Message("alias_opts[\"entry\"] is not defined") end deep_copy(ret) end |
- (Object) build_combobox_list(opts)
764 765 766 767 768 769 770 771 772 773 774 775 776 777 |
# File '../../src/include/multipath/options.rb', line 764 def build_combobox_list(opts) opts = deep_copy(opts) combobox_list = [] Builtins.foreach(Ops.get_list(opts, "list", [])) do |e| opt_str = Ops.get_string(e, "optstr", "NA") id = Ops.get_symbol(e, "id", :id) item = Item(Id(id), opt_str) combobox_list = Builtins.add(combobox_list, item) end if combobox_list == [] Popup.Message("build_combobox_list: nexpected empty combobox list.") end deep_copy(combobox_list) end |
- (Object) build_devnode_term(opt)
2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 |
# File '../../src/include/multipath/options.rb', line 2071 def build_devnode_term(opt) entry = Ops.get_map(@devnode_opts, "entry", {}) ret = Empty() if entry != {} id = Ops.get_symbol(entry, "id", :id) label_str = Ops.get_string(entry, "name", "NA") ret = TextEntry(Id(id), Opt(:notify), label_str, "") else Popup.Message("devnode_opts[\"entry\"] is not defined") end deep_copy(ret) end |
- (Object) build_failback_term(opt)
1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 |
# File '../../src/include/multipath/options.rb', line 1543 def build_failback_term(opt) ret = Empty() if opt == :editable_combobox_only ret = ComboBox( Id(:failback), Opt(:notify, :editable), Ops.get_string(@optlabel, "failback", "NA"), build_combobox_list(@failback_opts) ) elsif opt == :combobox_only ret = ComboBox( Id(:failback), Opt(:notify), Ops.get_string(@optlabel, "failback", "NA"), build_combobox_list(@failback_opts) ) elsif opt == :all ret = ReplacePoint( Id(:replace_failback), ComboBox( Id(:failback), Opt(:notify), Ops.get_string(@optlabel, "failback", "NA"), build_combobox_list(@failback_opts) ) ) else Popup.Message( Builtins.sformat("build_failback_term: unexpected opt %1", opt) ) end deep_copy(ret) end |
- (Object) build_features_term(opt)
1380 1381 1382 1383 1384 1385 1386 1387 |
# File '../../src/include/multipath/options.rb', line 1380 def build_features_term(opt) ComboBox( Id(:features), Opt(:notify), Ops.get_string(@optlabel, "features", "NA"), build_combobox_list(@features_opts) ) end |
- (Object) build_getuid_callout_term(opt)
1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 |
# File '../../src/include/multipath/options.rb', line 1162 def build_getuid_callout_term(opt) ret = Empty() if opt == :combobox_only ret = ComboBox( Id(:getuid_callout), Opt(:notify), Ops.get_string(@optlabel, "getuid_callout", "NA"), build_combobox_list(@getuid_callout_opts) ) elsif opt == :editable_combobox_only ret = ComboBox( Id(:getuid_callout), Opt(:notify, :editable), Ops.get_string(@optlabel, "getuid_callout", "NA"), build_combobox_list(@getuid_callout_opts) ) elsif opt == :all ret = ReplacePoint( Id(:replace_getuid_callout), ComboBox( Id(:getuid_callout), Opt(:notify), Ops.get_string(@optlabel, "getuid_callout", "NA"), build_combobox_list(@getuid_callout_opts) ) ) else Popup.Message( Builtins.sformat("build_getuid_callout_term: unexpected opt %1", opt) ) end deep_copy(ret) end |
- (Object) build_hardware_handler_term(opt)
2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 |
# File '../../src/include/multipath/options.rb', line 2343 def build_hardware_handler_term(opt) entry = Ops.get_map(@hardware_handler_opts, "entry", {}) ret = Empty() if entry != {} id = Ops.get_symbol(entry, "id", :id) label_str = Ops.get_string(entry, "name", "NA") ret = TextEntry(Id(id), Opt(:notify), label_str, "") else Popup.Message("hardware_opt[\"entry\"] is not defined") end deep_copy(ret) end |
- (Object) build_no_path_retry_term(opt)
1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 |
# File '../../src/include/multipath/options.rb', line 1810 def build_no_path_retry_term(opt) ret = Empty() if opt == :combobox_only ret = ComboBox( Id(:no_path_retry), Opt(:notify), Ops.get_string(@optlabel, "no_path_retry", "NA"), build_combobox_list(@no_path_retry_opts) ) elsif opt == :editable_combobox_only ret = ComboBox( Id(:no_path_retry), Opt(:notify, :editable), Ops.get_string(@optlabel, "no_path_retry", "NA"), build_combobox_list(@no_path_retry_opts) ) elsif opt == :all ret = ReplacePoint( Id(:replace_no_path_retry), ComboBox( Id(:no_path_retry), Opt(:notify), Ops.get_string(@optlabel, "no_path_retry", "NA"), build_combobox_list(@no_path_retry_opts) ) ) else Popup.Message( Builtins.sformat("build_no_path_retry_term: unexpected opt %1", opt) ) end deep_copy(ret) end |
- (Object) build_path_checker_term(opt)
1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 |
# File '../../src/include/multipath/options.rb', line 1442 def build_path_checker_term(opt) ret = Empty() if opt == :combobox_only ret = ComboBox( Id(:path_checker), Opt(:notify), Ops.get_string(@optlabel, "path_checker", "NA"), build_combobox_list(@path_checker_opts) ) elsif opt == :all ret = ReplacePoint( Id(:replace_path_checker), ComboBox( Id(:path_checker), Opt(:notify), Ops.get_string(@optlabel, "path_checker", "NA"), build_combobox_list(@path_checker_opts) ) ) else Popup.Message( Builtins.sformat("build_path_checker_term: unexpected opt %1", opt) ) end deep_copy(ret) end |
- (Object) build_path_gp_term(opt)
1084 1085 1086 1087 1088 1089 1090 1091 |
# File '../../src/include/multipath/options.rb', line 1084 def build_path_gp_term(opt) ComboBox( Id(:path_grouping_policy), Opt(:notify), Ops.get_string(@optlabel, "path_grouping_policy", "NA"), build_combobox_list(@path_gp_opts) ) end |
- (Object) build_path_selector_term(opt)
999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 |
# File '../../src/include/multipath/options.rb', line 999 def build_path_selector_term(opt) ret = Empty() if opt == :combobox_only ret = ComboBox( Id(:path_selector), Opt(:notify), Ops.get_string(@optlabel, "path_selector", "NA"), build_combobox_list(@path_selector_opts) ) elsif opt == :all ret = ReplacePoint( Id(:replace_path_selector), ComboBox( Id(:path_selector), Opt(:notify), Ops.get_string(@optlabel, "path_selector", "NA"), build_combobox_list(@path_selector_opts) ) ) else Popup.Message( Builtins.sformat("build_path_selector_term: unexpected opt %1", ret) ) end deep_copy(ret) end |
- (Object) build_polling_interval_term(opt)
779 780 781 782 783 784 785 786 787 788 789 790 |
# File '../../src/include/multipath/options.rb', line 779 def build_polling_interval_term(opt) entry = Ops.get_map(@polling_interval_opts, "entry", {}) ret = Empty() if entry != {} id = Ops.get_symbol(entry, "id", :id) label_str = Ops.get_string(entry, "name", "NA") ret = TextEntry(Id(id), Opt(:notify), label_str, "") else Popup.Message("polling_interval_opts[\"entry\"] is not defined") end deep_copy(ret) end |
- (Object) build_prio_callout_term(opt)
1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 |
# File '../../src/include/multipath/options.rb', line 1276 def build_prio_callout_term(opt) ret = Empty() if opt == :combobox_only ret = ComboBox( Id(:prio_callout), Opt(:notify), Ops.get_string(@optlabel, "prio_callout", "NA"), build_combobox_list(@prio_callout_opts) ) elsif opt == :all ret = ReplacePoint( Id(:replace_prio_callout), ComboBox( Id(:prio_callout), Opt(:notify), Ops.get_string(@optlabel, "prio_callout", "NA"), build_combobox_list(@prio_callout_opts) ) ) else Popup.Message( Builtins.sformat("build_prio_callout_term: unexpected opt %1", opt) ) end deep_copy(ret) end |
- (Object) build_product_blacklist_term(opt)
2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 |
# File '../../src/include/multipath/options.rb', line 2287 def build_product_blacklist_term(opt) entry = Ops.get_map(@product_blacklist_opts, "entry", {}) ret = Empty() if entry != {} id = Ops.get_symbol(entry, "id", :id) label_str = Ops.get_string(entry, "name", "NA") ret = TextEntry(Id(id), Opt(:notify), label_str, "") else Popup.Message("product_blacklist_opts[\"entry\"] is not defined") end deep_copy(ret) end |
- (Object) build_product_term(opt)
2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 |
# File '../../src/include/multipath/options.rb', line 2232 def build_product_term(opt) entry = Ops.get_map(@product_opts, "entry", {}) ret = Empty() if entry != {} id = Ops.get_symbol(entry, "id", :id) label_str = Ops.get_string(entry, "name", "NA") ret = TextEntry(Id(id), Opt(:notify), label_str, "") else Popup.Message("product_opts[\"entry\"] is not defined") end deep_copy(ret) end |
- (Object) build_rr_min_io_term(opt)
1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 |
# File '../../src/include/multipath/options.rb', line 1686 def build_rr_min_io_term(opt) entry = Ops.get_map(@rr_min_io_opts, "entry", {}) ret = Empty() if entry != {} id = Ops.get_symbol(entry, "id", :id) label_str = Ops.get_string(entry, "name", "NA") ret = TextEntry(Id(id), Opt(:notify), label_str, "") else Popup.Message("rr_min_io_opts[\"entry\"] is not defined") end deep_copy(ret) end |
- (Object) build_rr_weight_term(opt)
1749 1750 1751 1752 1753 1754 1755 1756 |
# File '../../src/include/multipath/options.rb', line 1749 def build_rr_weight_term(opt) ComboBox( Id(:rr_weight), Opt(:notify), Ops.get_string(@optlabel, "rr_weight", "NA"), build_combobox_list(@rr_weight_opts) ) end |
- (Object) build_selector_term(opt)
916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 |
# File '../../src/include/multipath/options.rb', line 916 def build_selector_term(opt) ret = Empty() if opt == :combobox_only ret = ComboBox( Id(:selector), Opt(:notify), Ops.get_string(@optlabel, "selector", "NA"), build_combobox_list(@selector_opts) ) elsif opt == :all ret = ReplacePoint( Id(:replace_selector), ComboBox( Id(:selector), Opt(:notify), Ops.get_string(@optlabel, "selector", "NA"), build_combobox_list(@selector_opts) ) ) else Popup.Message( Builtins.sformat("build_selector_term: unexpected opt %1", opt) ) end deep_copy(ret) end |
- (Object) build_udev_dir_term(opt)
863 864 865 866 867 868 869 870 871 872 873 874 |
# File '../../src/include/multipath/options.rb', line 863 def build_udev_dir_term(opt) entry = Ops.get_map(@udev_dir_opts, "entry", {}) ret = Empty() if entry != {} id = Ops.get_symbol(entry, "id", :id) label_str = Ops.get_string(entry, "name", "NA") ret = TextEntry(Id(id), Opt(:notify), label_str, "") else Popup.Message("udev_dir_opts[\"entry\"] is not defined") end deep_copy(ret) end |
- (Object) build_user_friendly_names_term(opt)
1955 1956 1957 1958 1959 1960 1961 1962 |
# File '../../src/include/multipath/options.rb', line 1955 def build_user_friendly_names_term(opt) ComboBox( Id(:user_friendly_names), Opt(:notify), Ops.get_string(@optlabel, "user_friendly_names", "NA"), build_combobox_list(@user_friendly_names_opts) ) end |
- (Object) build_valid_chars(key)
744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 |
# File '../../src/include/multipath/options.rb', line 744 def build_valid_chars(key) valid_chars = { "path" => " %./-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", "wwid" => ".-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", "number" => "0123456789", "devnode" => " ^!\".*?()|[]/\\-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", "vendor" => " ^!\".*?()|[]/\\-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", "product" => " ^!\".*?()|[]/\\-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", "product_blacklist" => " ^!\".*?()|[]/\\-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", "hardware_handler" => " ^!\".*?()|[]/\\-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", "alias" => ".-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" } if Builtins.haskey(valid_chars, key) == false Popup.Message(Builtins.sformat("can not find valid chars for %1", key)) return "" else return Ops.get_string(valid_chars, key, "") end end |
- (Object) build_vendor_term(opt)
2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 |
# File '../../src/include/multipath/options.rb', line 2176 def build_vendor_term(opt) entry = Ops.get_map(@vendor_opts, "entry", {}) ret = Empty() if entry != {} id = Ops.get_symbol(entry, "id", :id) label_str = Ops.get_string(entry, "name", "NA") ret = TextEntry(Id(id), Opt(:notify), label_str, "") else Popup.Message("vendor_opts[\"entry\"] is not defined") end deep_copy(ret) end |
- (Object) build_wwid_term(opt)
2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 |
# File '../../src/include/multipath/options.rb', line 2022 def build_wwid_term(opt) entry = Ops.get_map(@wwid_opts, "entry", {}) ret = Empty() if entry != {} id = Ops.get_symbol(entry, "id", :id) label_str = Ops.get_string(entry, "name", "NA") ret = TextEntry(Id(id), Opt(:notify), label_str, "") else Popup.Message("wwid_opt[\"entry\"] is not defined") end deep_copy(ret) end |
- (Object) check_alias(item)
2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 |
# File '../../src/include/multipath/options.rb', line 2162 def check_alias(item) item = deep_copy(item) ret = {} value = Ops.get_string(item, "alias", "") if value == Builtins.toascii(value) Ops.set(ret, "result", true) Ops.set(ret, "info", "") else Ops.set(ret, "result", false) Ops.set(ret, "info", "* \"alias\" " + _("illegal value") + "\n") end deep_copy(ret) end |
- (Object) check_devnode(item)
2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 |
# File '../../src/include/multipath/options.rb', line 2108 def check_devnode(item) item = deep_copy(item) header = "* \"devnode\" " ret = {} value = Ops.get_string(item, "devnode", "") if value == "" || Builtins.regexpmatch(value, "^[ \t]+$") Ops.set(ret, "result", false) Ops.set( ret, "info", Ops.add(Ops.add(header, _("should not be empty")), "\n") ) else Ops.set(ret, "result", true) Ops.set(ret, "info", "") end deep_copy(ret) end |
- (Object) check_failback(item)
1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 |
# File '../../src/include/multipath/options.rb', line 1650 def check_failback(item) item = deep_copy(item) ret = {} value = Ops.get_string(item, "failback", "") if value == "" || value == "immediate" || value == "manual" Ops.set(ret, "result", true) Ops.set(ret, "info", "") elsif Builtins.substring(value, 0, 1) == "0" Ops.set(ret, "result", false) Ops.set( ret, "info", "* \"failback\" " + _("should be a decimal integer") + "\n" ) elsif Builtins.tointeger(value) == nil || value != Builtins.tostring(Builtins.tointeger(value)) || value == "0" Ops.set(ret, "result", false) Ops.set(ret, "info", "* \"failback\" " + _("illegal value") + "\n") elsif Ops.less_or_equal(Builtins.tointeger(value), 0) Ops.set(ret, "result", false) Ops.set( ret, "info", "* \"failback\" " + _("should be greater than 0") + "\n" ) elsif value == Builtins.tostring(Builtins.tointeger(value)) Ops.set(ret, "result", true) Ops.set(ret, "info", "") else Ops.set(ret, "result", false) Ops.set(ret, "info", "* \"failback\" " + _("illegal value") + "\n") end deep_copy(ret) end |
- (Object) check_features(item)
1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 |
# File '../../src/include/multipath/options.rb', line 1427 def check_features(item) item = deep_copy(item) header = "* \"features\" " ret = {} value = Ops.get_string(item, "features", "") if value == "" || value == "1 queue_if_no_path" || value == "0" Ops.set(ret, "result", true) Ops.set(ret, "info", "") else Ops.set(ret, "result", false) Ops.set(ret, "info", Ops.add(Ops.add(header, _("illegal value")), "\n")) end deep_copy(ret) end |
- (Object) check_getuid_callout(item)
1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 |
# File '../../src/include/multipath/options.rb', line 1257 def check_getuid_callout(item) item = deep_copy(item) header = "* \"getuid_callout\" " ret = {} value = Ops.get_string(item, "getuid_callout", "") if value == "" || value == "/sbin/scsi_id -g -u -s" Ops.set(ret, "result", true) Ops.set(ret, "info", "") elsif value == Builtins.toascii(value) Ops.set(ret, "result", true) Ops.set(ret, "info", "") else Ops.set(ret, "result", false) Ops.set(ret, "info", Ops.add(Ops.add(header, _("illegal value")), "\n")) end deep_copy(ret) end |
- (Object) check_hardware_handler(item)
2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 |
# File '../../src/include/multipath/options.rb', line 2384 def check_hardware_handler(item) item = deep_copy(item) header = "* \"hardware_handler\" " ret = {} value = Ops.get_string(item, "hardware_handler", "") if value == "" || value == Builtins.toascii(value) Ops.set(ret, "result", true) Ops.set(ret, "info", "") else Ops.set(ret, "result", false) Ops.set(ret, "info", Ops.add(Ops.add(header, _("illegal value")), "\n")) end deep_copy(ret) end |
- (Object) check_no_path_retry(item)
1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 |
# File '../../src/include/multipath/options.rb', line 1927 def check_no_path_retry(item) item = deep_copy(item) ret = {} value = Ops.get_string(item, "no_path_retry", "") if value == "" || value == "fail" || value == "queue" Ops.set(ret, "result", true) Ops.set(ret, "info", "") elsif value != "0" && Builtins.substring(value, 0, 1) == "0" Ops.set(ret, "result", false) Ops.set( ret, "info", "* \"no_path_retry\" " + _("should be a decimal integer") + "\n" ) elsif Builtins.tointeger(value) == nil || value != Builtins.tostring(Builtins.tointeger(value)) Ops.set(ret, "result", false) Ops.set(ret, "info", "* \"no_path_retry\" " + _("illegal value") + "\n") elsif value == Builtins.tostring(Builtins.tointeger(value)) Ops.set(ret, "result", true) Ops.set(ret, "info", "") else Ops.set(ret, "result", false) Ops.set(ret, "info", "* \"no_path_retry\" " + _("illegal value") + "\n") end deep_copy(ret) end |
- (Object) check_path_checker(item)
1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 |
# File '../../src/include/multipath/options.rb', line 1525 def check_path_checker(item) item = deep_copy(item) ret = {} value = Ops.get_string(item, "path_checker", "") if value == "" || value == "readsector0" || value == "tur" || value == "emc_clariion" || value == "hp_sw" || value == "rdac" || value == "directio" Ops.set(ret, "result", true) Ops.set(ret, "info", "") else Ops.set(ret, "result", false) Ops.set(ret, "info", "* \"path_checker\" " + _("illegal value") + "\n") end deep_copy(ret) end |
- (Object) check_path_gp(item)
1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 |
# File '../../src/include/multipath/options.rb', line 1141 def check_path_gp(item) item = deep_copy(item) ret = {} value = Ops.get_string(item, "path_grouping_policy", "") if value == "" || value == "failover" || value == "multibus" || value == "group_by_serial" || value == "group_by_prio" || value == "group_by_node_name" Ops.set(ret, "result", true) Ops.set(ret, "info", "") else Ops.set(ret, "result", false) Ops.set( ret, "info", "* \"path_grouping_policy\" " + _("illegal value") + "\n" ) end deep_copy(ret) end |
- (Object) check_path_selector(item)
1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 |
# File '../../src/include/multipath/options.rb', line 1070 def check_path_selector(item) item = deep_copy(item) ret = {} value = Ops.get_string(item, "path_selector", "") if value == "" || value == "round-robin 0" || value == "service-time 0" || value == "queue-length 0" Ops.set(ret, "result", true) Ops.set(ret, "info", "") else Ops.set(ret, "result", false) Ops.set(ret, "info", "* \"path_selector\" " + _("illegal value") + "\n") end deep_copy(ret) end |
- (Object) check_polling_interval(item)
820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 |
# File '../../src/include/multipath/options.rb', line 820 def check_polling_interval(item) item = deep_copy(item) ret = {} value = Ops.get_string(item, "polling_interval", "") if value == "" Ops.set(ret, "result", true) Ops.set(ret, "info", "") elsif value != "0" && Builtins.substring(value, 0, 1) == "0" Ops.set(ret, "result", false) Ops.set( ret, "info", "* \"polling_interval\" " + _("should be a decimal integer") + "\n" ) elsif Builtins.tointeger(value) == nil || value != Builtins.tostring(Builtins.tointeger(value)) Ops.set(ret, "result", false) Ops.set( ret, "info", "* \"polling_interval\" " + _("illegal value") + "\n" ) elsif Ops.less_than(Builtins.tointeger(value), 0) Ops.set(ret, "result", false) Ops.set( ret, "info", "* \"polling_interval\" " + _("should be greater than 0") + "\n" ) elsif value == Builtins.tostring(Builtins.tointeger(value)) Ops.set(ret, "result", true) Ops.set(ret, "info", "") else Ops.set(ret, "result", false) Ops.set( ret, "info", "* \"polling_interval\" " + _("illegal value") + "\n" ) end deep_copy(ret) end |
- (Object) check_prio_callout(item)
1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 |
# File '../../src/include/multipath/options.rb', line 1359 def check_prio_callout(item) item = deep_copy(item) header = "* \"prio_callout\" " ret = {} value = Ops.get_string(item, "prio_callout", "") if value == "" || value == "mpath_prio_emc /dev/%n" || value == "mpath_prio_alua /dev/%n" || value == "mpath_prio_netapp /dev/%n" || value == "mpath_prio_tpc /dev/%n" || value == "mpath_prio_hp_sw /dev/%n" || value == "mpath_prio_hds_modular %b" Ops.set(ret, "result", true) Ops.set(ret, "info", "") else Ops.set(ret, "result", false) Ops.set(ret, "info", Ops.add(Ops.add(header, _("illegal value")), "\n")) end deep_copy(ret) end |
- (Object) check_product(item)
2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 |
# File '../../src/include/multipath/options.rb', line 2268 def check_product(item) item = deep_copy(item) header = "* \"product\" " ret = {} value = Ops.get_string(item, "product", "") if value == "" || Builtins.regexpmatch(value, "^[ \t]+$") Ops.set(ret, "result", false) Ops.set( ret, "info", Ops.add(Ops.add(header, _("should not be empty")), "\n") ) else Ops.set(ret, "result", true) Ops.set(ret, "info", "") end deep_copy(ret) end |
- (Object) check_product_blacklist(item)
2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 |
# File '../../src/include/multipath/options.rb', line 2328 def check_product_blacklist(item) item = deep_copy(item) header = "* \"product_blacklist\" " ret = {} value = Ops.get_string(item, "product_blacklist", "") if value != Builtins.toascii(value) Ops.set(ret, "result", false) Ops.set(ret, "info", Ops.add(Ops.add(header, _("illegal value")), "\n")) else Ops.set(ret, "result", true) Ops.set(ret, "info", "") end deep_copy(ret) end |
- (Object) check_rr_min_io(item)
1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 |
# File '../../src/include/multipath/options.rb', line 1717 def check_rr_min_io(item) item = deep_copy(item) ret = {} value = Ops.get_string(item, "rr_min_io", "") if value != "0" && Builtins.substring(value, 0, 1) == "0" Ops.set(ret, "result", false) Ops.set( ret, "info", "* \"rr_min_io\" " + _("should be a decimal integer") + "\n" ) elsif value == "" Ops.set(ret, "result", true) Ops.set(ret, "info", "") elsif Builtins.tointeger(value) == nil || value != Builtins.tostring(Builtins.tointeger(value)) Ops.set(ret, "result", false) Ops.set( ret, "info", "* \"rr_min_io\" " + _("invalid decimal integer") + "\n" ) elsif value == Builtins.tostring(Builtins.tointeger(value)) Ops.set(ret, "result", true) Ops.set(ret, "info", "") else Ops.set(ret, "result", false) Ops.set(ret, "info", "* \"rr_min_io\" " + _("illegal value") + "\n") end deep_copy(ret) end |
- (Object) check_rr_weight(item)
1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 |
# File '../../src/include/multipath/options.rb', line 1795 def check_rr_weight(item) item = deep_copy(item) header = "* \"rr_weight\" " ret = {} value = Ops.get_string(item, "rr_weight", "") if value == "" || value == "priorities" || value == "uniform" Ops.set(ret, "result", true) Ops.set(ret, "info", "") else Ops.set(ret, "result", false) Ops.set(ret, "info", Ops.add(Ops.add(header, _("illegal value")), "\n")) end deep_copy(ret) end |
- (Object) check_selector(item)
984 985 986 987 988 989 990 991 992 993 994 995 996 997 |
# File '../../src/include/multipath/options.rb', line 984 def check_selector(item) item = deep_copy(item) header = "* \"selector\" " ret = {} value = Ops.get_string(item, "selector", "") if value == "" || value == "round-robin 0" || value == "service-time 0" || value =="queue-length 0" Ops.set(ret, "result", true) Ops.set(ret, "info", "") else Ops.set(ret, "result", false) Ops.set(ret, "info", Ops.add(Ops.add(header, _("illegal value")), "\n")) end deep_copy(ret) end |
- (Object) check_udev_dir(item)
900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 |
# File '../../src/include/multipath/options.rb', line 900 def check_udev_dir(item) item = deep_copy(item) header = "* \"udev_dir\" " ret = {} value = Ops.get_string(item, "udev_dir", "") if value == "" || value == Builtins.toascii(value) Ops.set(ret, "result", true) Ops.set(ret, "info", "") else Ops.set(ret, "result", false) Ops.set(ret, "info", Ops.add(Ops.add(header, _("illegal value")), "\n")) end deep_copy(ret) end |
- (Object) check_user_friendly_names(item)
2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 |
# File '../../src/include/multipath/options.rb', line 2007 def check_user_friendly_names(item) item = deep_copy(item) header = "* \"user_friendly_names\" " ret = {} value = Ops.get_string(item, "user_friendly_names", "") if value == "" || value == "yes" || value == "no" Ops.set(ret, "result", true) Ops.set(ret, "info", "") else Ops.set(ret, "result", false) Ops.set(ret, "info", Ops.add(Ops.add(header, _("illegal value")), "\n")) end deep_copy(ret) end |
- (Object) check_vendor(item)
2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 |
# File '../../src/include/multipath/options.rb', line 2213 def check_vendor(item) item = deep_copy(item) header = "* \"vendor\" " ret = {} value = Ops.get_string(item, "vendor", "") if value == "" || Builtins.regexpmatch(value, "^[ \t]+$") Ops.set(ret, "result", false) Ops.set( ret, "info", Ops.add(Ops.add(header, _("should not be empty")), "\n") ) else Ops.set(ret, "result", true) Ops.set(ret, "info", "") end deep_copy(ret) end |
- (Object) check_wwid(item)
2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 |
# File '../../src/include/multipath/options.rb', line 2057 def check_wwid(item) item = deep_copy(item) ret = {} value = Ops.get_string(item, "wwid", "") if value == "" || Builtins.regexpmatch(value, "^[ \t]+$") Ops.set(ret, "result", false) Ops.set(ret, "info", "* \"wwid\" " + _("should not be empty") + "\n") else Ops.set(ret, "result", true) Ops.set(ret, "info", "") end deep_copy(ret) end |
- (Object) devnode_handler(item)
2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 |
# File '../../src/include/multipath/options.rb', line 2093 def devnode_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:devnode), :Value) if Ops.is_string?(ret) == true value = Convert.to_string(ret) else Popup.Message( Builtins.sformat("devnode_handler: unexpected ret %1", ret) ) end Ops.set(item, "devnode", value) deep_copy(item) end |
- (Object) failback_handler(item)
1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 |
# File '../../src/include/multipath/options.rb', line 1598 def failback_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:failback), :Value) if ret == :immediate UI.ReplaceWidget( Id(:replace_failback), build_failback_term(:combobox_only) ) UI.ChangeWidget(Id(:failback), :Value, :immediate) value = "immediate" elsif ret == :manual UI.ReplaceWidget( Id(:replace_failback), build_failback_term(:combobox_only) ) UI.ChangeWidget(Id(:failback), :Value, :manual) value = "manual" elsif ret == :customized_str value = Ops.get_string(@temp_string_values, "failback", "") UI.ReplaceWidget( Id(:replace_failback), build_failback_term(:editable_combobox_only) ) UI.ChangeWidget(Id(:failback), :ValidChars, build_valid_chars("number")) UI.ChangeWidget(Id(:failback), :Value, value) UI.SetFocus(Id(:failback)) @replacewidget_notify = true elsif ret == "0" value = "" UI.ReplaceWidget( Id(:replace_failback), build_failback_term(:editable_combobox_only) ) UI.ChangeWidget(Id(:failback), :ValidChars, build_valid_chars("number")) UI.SetFocus(Id(:failback)) UI.ChangeWidget(Id(:failback), :Value, " ") @replacewidget_notify = true elsif ret == "" value = "" elsif Builtins.tointeger(ret) != nil value = Convert.to_string(ret) Ops.set(@temp_string_values, "failback", value) else Popup.Message( Builtins.sformat("failback_handler: unexpected ret %1", ret) ) end Ops.set(item, "failback", value) deep_copy(item) end |
- (Object) features_handler(item)
1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 |
# File '../../src/include/multipath/options.rb', line 1408 def features_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:features), :Value) if ret == :queue_if_no_path value = "1 queue_if_no_path" elsif ret == :zero value = "0" elsif ret == :none value = "" else Popup.Message( Builtins.sformat("features_handler: unexpected ret %1", ret) ) end Ops.set(item, "features", value) deep_copy(item) end |
- (Object) get_newid(items)
get a new id for new item, this will help to make each item unique.
676 677 678 679 680 681 682 683 684 685 686 |
# File '../../src/include/multipath/options.rb', line 676 def get_newid(items) items = deep_copy(items) newid = 0 Builtins.foreach(items) do |e| e_id = 0 e_id = Builtins.tointeger(Ops.get_string(e, "id", "0")) newid = e_id if Ops.less_than(newid, e_id) end newid = Ops.add(newid, 1) Builtins.tostring(newid) end |
- (Object) getuid_callout_handler(item)
1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 |
# File '../../src/include/multipath/options.rb', line 1218 def getuid_callout_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:getuid_callout), :Value) if ret == :default UI.ReplaceWidget( Id(:replace_getuid_callout), build_getuid_callout_term(:combobox_only) ) UI.ChangeWidget(Id(:getuid_callout), :Value, :default) value = "/sbin/scsi_id -g -u -s" elsif ret == :customized_str value = Ops.get_string(@temp_string_values, "getuid_callout", "") UI.ReplaceWidget( Id(:replace_getuid_callout), build_getuid_callout_term(:editable_combobox_only) ) UI.ChangeWidget( Id(:getuid_callout), :ValidChars, build_valid_chars("path") ) UI.ChangeWidget(Id(:getuid_callout), :Value, value) UI.SetFocus(Id(:getuid_callout)) # replacewidget_notify = true; elsif ret == "" value = "" elsif Convert.to_string(ret) == Builtins.toascii(Convert.to_string(ret)) value = Convert.to_string(ret) Ops.set(@temp_string_values, "getuid_callout", value) else Popup.Message( Builtins.sformat("getuid_callout_handler: unexpected ret %1", ret) ) end Ops.set(item, "getuid_callout", value) deep_copy(item) end |
- (Object) hardware_handler_handler(item)
2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 |
# File '../../src/include/multipath/options.rb', line 2369 def hardware_handler_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:hardware_handler), :Value) if Ops.is_string?(ret) == true value = Convert.to_string(ret) else Popup.Message( Builtins.sformat("hardware_handler_handler: unexpected ret %1", ret) ) end Ops.set(item, "hardware_handler", value) deep_copy(item) end |
- (Object) initialize_multipath_options(include_target)
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 |
# File '../../src/include/multipath/options.rb', line 34 def (include_target) Yast.import "UI" Yast.import "Popup" textdomain "multipath" # hold temporary customized string value of combobox @temp_string_values = {} @replacewidget_notify = false @optlabel = { "polling_interval" => "polling_interval", "udev_dir" => "udev_dir", "selector" => "selector", "path_selector" => "path_selector", "path_grouping_policy" => "path_grouping_policy", "getuid_callout" => "getuid_callout", "prio_callout" => "prio_callout", "features" => "features", "path_checker" => "path_checker", "failback" => "failback", "rr_min_io" => "rr_min_io", "rr_weight" => "rr_weight", "no_path_retry" => "no_path_retry", "user_friendly_names" => "user_friendly_names", "wwid" => "wwid", "devnode" => "devnode", "alias" => "alias", "vendor" => "vendor", "product" => "product", "product_blacklist" => "product_blacklist", "hardware_handler" => "hardware_handler" } @polling_interval_opts = { "type" => "textentry", "entry" => { "name" => Ops.get_string(@optlabel, "polling_interval", "NA"), "id" => :polling_interval } } @udev_dir_opts = { "type" => "textentry", "entry" => { "name" => Ops.get_string(@optlabel, "udev_dir", "NA"), "id" => :udev_dir } } @selector_opts = { "type" => "combobox", "list" => [ { "name" => "round_robin", "id" => :round_robin, "optstr" => "\"round-robin 0\"" }, { "name" => "none", "id" => :none, "optstr" => "" } ] } @path_selector_opts = { "type" => "combobox", "list" => [ { "name" => "round_robin", "id" => :round_robin, "optstr" => "\"round-robin 0\"" }, { "name" => "service_time", "id" => :service_time, "optstr" => "\"service-time 0\"" }, { "name" => "queue_length", "id" => :queue_length, "optstr" => "\"queue-length 0\"" }, { "name" => "none", "id" => :none, "optstr" => "" } ] } @path_gp_opts = { "type" => "combobox", "list" => [ { "name" => "failover", "id" => :failover, "optstr" => "failover" }, { "name" => "multibus", "id" => :multibus, "optstr" => "multibus" }, { "name" => "group_by_serial", "id" => :group_by_serial, "optstr" => "group_by_serial" }, { "name" => "group_by_prio", "id" => :group_by_prio, "optstr" => "group_by_prio" }, { "name" => "group_by_node_name", "id" => :group_by_node_name, "optstr" => "group_by_node_name" }, { "name" => "none", "id" => :none, "optstr" => "" } ] } @getuid_callout_opts = { "type" => "combobox", "list" => [ { "name" => "default", "id" => :default, "optstr" => "\"/sbin/scsi_id -g -u -s\"" }, { "name" => "customized_str", "id" => :customized_str, "optstr" => "(callout path string)" } ] } @prio_callout_opts = { "type" => "combobox", "list" => [ { "name" => "prio_emc", "id" => :prio_emc, "optstr" => "\"mpath_prio_emc /dev/%n\"" }, { "name" => "prio_alua", "id" => :prio_alua, "optstr" => "\"mpath_prio_alua /dev/%n\"" }, { "name" => "prio_netapp", "id" => :prio_netapp, "optstr" => "\"mpath_prio_netapp /dev/%n\"" }, { "name" => "prio_tpc", "id" => :prio_tpc, "optstr" => "\"mpath_prio_tpc /dev/%n\"" }, { "name" => "prio_hp_sw", "id" => :prio_hp_sw, "optstr" => "\"mpath_prio_hp_sw /dev/%n\"" }, { "name" => "prio_hds_mod", "id" => :prio_hds_mod, "optstr" => "\"mpath_prio_hds_modular %b\"" }, { "name" => "none", "id" => :none, "optstr" => "" } ] } @features_opts = { "type" => "combobox", "list" => [ { "name" => "0", "id" => :zero, "optstr" => "0" }, { "name" => "queue_if_no_path", "id" => :queue_if_no_path, "optstr" => "\"1 queue_if_no_path\"" }, { "name" => "none", "id" => :none, "optstr" => "" } ] } @path_checker_opts = { "type" => "combobox", "list" => [ { "name" => "readsector0", "id" => :readsector0, "optstr" => "readsector0" }, { "name" => "tur", "id" => :tur, "optstr" => "tur" }, { "name" => "emc_clariion", "id" => :emc_clariion, "optstr" => "emc_clariion" }, { "name" => "hp_sw", "id" => :hp_sw, "optstr" => "hp_sw" }, { "name" => "rdac", "id" => :rdac, "optstr" => "rdac" }, { "name" => "directio", "id" => :directio, "optstr" => "directio" }, { "name" => "none", "id" => :none, "optstr" => "" } ] } @failback_opts = { "type" => "combobox", "list" => [ { "name" => "manual", "id" => :manual, "optstr" => "manual" }, { "name" => "immediate", "id" => :immediate, "optstr" => "immediate" }, { "name" => "customized_str", "id" => :customized_str, "optstr" => "(number > 0)" } ] } @rr_min_io_opts = { "type" => "textentry", "entry" => { "name" => Ops.get_string(@optlabel, "rr_min_io", "NA"), "id" => :rr_min_io } } @rr_weight_opts = { "type" => "combobox", "list" => [ { "name" => "priorities", "id" => :priorities, "optstr" => "priorities" }, { "name" => "uniform", "id" => :uniform, "optstr" => "uniform" }, { "name" => "none", "id" => :none, "optstr" => "" } ] } @no_path_retry_opts = { "type" => "combobox", "list" => [ { "name" => "fail", "id" => :fail, "optstr" => "fail" }, { "name" => "queue", "id" => :queue, "optstr" => "queue" }, { "name" => "customized_str", "id" => :customized_str, "optstr" => "(number >= 0)" } ] } @user_friendly_names_opts = { "type" => "combobox", "list" => [ { "name" => "yes", "id" => :yes, "optstr" => "yes" }, { "name" => "no", "id" => :no, "optstr" => "no" }, { "name" => "none", "id" => :none, "optstr" => "" } ] } @wwid_opts = { "type" => "textentry", "entry" => { "name" => Ops.get_string(@optlabel, "wwid", "NA"), "id" => :wwid } } @devnode_opts = { "type" => "textentry", "entry" => { "name" => Ops.get_string(@optlabel, "devnode", "NA"), "id" => :devnode } } @alias_opts = { "type" => "textentry", "entry" => { "name" => Ops.get_string(@optlabel, "alias", "NA"), "id" => :alias } } @vendor_opts = { "type" => "textentry", "entry" => { "name" => Ops.get_string(@optlabel, "vendor", "NA"), "id" => :vendor } } @product_opts = { "type" => "textentry", "entry" => { "name" => Ops.get_string(@optlabel, "product", "NA"), "id" => :product } } @product_blacklist_opts = { "type" => "textentry", "entry" => { "name" => Ops.get_string(@optlabel, "product_blacklist", "NA"), "id" => :product_blacklist } } @hardware_handler_opts = { "type" => "textentry", "entry" => { "name" => Ops.get_string(@optlabel, "hardware_handler", "NA"), "id" => :hardware_handler } } @build_term_handlers = { :polling_interval => fun_ref( method(:build_polling_interval_term), "term (symbol)" ), :udev_dir => fun_ref( method(:build_udev_dir_term), "term (symbol)" ), :selector => fun_ref( method(:build_selector_term), "term (symbol)" ), :path_selector => fun_ref( method(:build_path_selector_term), "term (symbol)" ), :path_grouping_policy => fun_ref( method(:build_path_gp_term), "term (symbol)" ), :getuid_callout => fun_ref( method(:build_getuid_callout_term), "term (symbol)" ), :prio_callout => fun_ref( method(:build_prio_callout_term), "term (symbol)" ), :features => fun_ref( method(:build_features_term), "term (symbol)" ), :path_checker => fun_ref( method(:build_path_checker_term), "term (symbol)" ), :failback => fun_ref( method(:build_failback_term), "term (symbol)" ), :rr_min_io => fun_ref( method(:build_rr_min_io_term), "term (symbol)" ), :rr_weight => fun_ref( method(:build_rr_weight_term), "term (symbol)" ), :no_path_retry => fun_ref( method(:build_no_path_retry_term), "term (symbol)" ), :user_friendly_names => fun_ref( method(:build_user_friendly_names_term), "term (symbol)" ), :wwid => fun_ref( method(:build_wwid_term), "term (symbol)" ), :devnode => fun_ref( method(:build_devnode_term), "term (symbol)" ), :alias => fun_ref( method(:build_alias_term), "term (symbol)" ), :vendor => fun_ref( method(:build_vendor_term), "term (symbol)" ), :product => fun_ref( method(:build_product_term), "term (symbol)" ), :product_blacklist => fun_ref( method(:build_product_blacklist_term), "term (symbol)" ), :hardware_handler => fun_ref( method(:build_hardware_handler_term), "term (symbol)" ) } @update_term_handlers = { :polling_interval => fun_ref( method(:update_polling_interval_term), "void (map)" ), :udev_dir => fun_ref( method(:update_udev_dir_term), "void (map)" ), :selector => fun_ref( method(:update_selector_term), "void (map)" ), :path_selector => fun_ref( method(:update_path_selector_term), "void (map)" ), :path_grouping_policy => fun_ref( method(:update_path_gp_term), "void (map)" ), :getuid_callout => fun_ref( method(:update_getuid_callout_term), "void (map)" ), :prio_callout => fun_ref( method(:update_prio_callout_term), "void (map)" ), :features => fun_ref( method(:update_features_term), "void (map)" ), :path_checker => fun_ref( method(:update_path_checker_term), "void (map)" ), :failback => fun_ref( method(:update_failback_term), "void (map)" ), :rr_min_io => fun_ref( method(:update_rr_min_io_term), "void (map)" ), :rr_weight => fun_ref( method(:update_rr_weight_term), "void (map)" ), :no_path_retry => fun_ref( method(:update_no_path_retry_term), "void (map)" ), :user_friendly_names => fun_ref( method(:update_user_friendly_names_term), "void (map)" ), :wwid => fun_ref( method(:update_wwid_term), "void (map)" ), :devnode => fun_ref( method(:update_devnode_term), "void (map)" ), :alias => fun_ref( method(:update_alias_term), "void (map)" ), :vendor => fun_ref( method(:update_vendor_term), "void (map)" ), :product => fun_ref( method(:update_product_term), "void (map)" ), :product_blacklist => fun_ref( method(:update_product_blacklist_term), "void (map)" ), :hardware_handler => fun_ref( method(:update_hardware_handler_term), "void (map)" ) } @default_item_handlers = { :polling_interval => fun_ref( method(:polling_interval_handler), "map (map)" ), :udev_dir => fun_ref(method(:udev_dir_handler), "map (map)"), :selector => fun_ref(method(:selector_handler), "map (map)"), :path_selector => fun_ref( method(:path_selector_handler), "map (map)" ), :path_grouping_policy => fun_ref(method(:path_gp_handler), "map (map)"), :getuid_callout => fun_ref( method(:getuid_callout_handler), "map (map)" ), :prio_callout => fun_ref( method(:prio_callout_handler), "map (map)" ), :features => fun_ref(method(:features_handler), "map (map)"), :path_checker => fun_ref( method(:path_checker_handler), "map (map)" ), :failback => fun_ref(method(:failback_handler), "map (map)"), :rr_min_io => fun_ref( method(:rr_min_io_handler), "map (map)" ), :rr_weight => fun_ref( method(:rr_weight_handler), "map (map)" ), :no_path_retry => fun_ref( method(:no_path_retry_handler), "map (map)" ), :user_friendly_names => fun_ref( method(:user_friendly_names_handler), "map (map)" ), :wwid => fun_ref(method(:wwid_handler), "map (map)"), :devnode => fun_ref(method(:devnode_handler), "map (map)"), :alias => fun_ref(method(:alias_handler), "map (map)"), :vendor => fun_ref(method(:vendor_handler), "map (map)"), :product => fun_ref(method(:product_handler), "map (map)"), :product_blacklist => fun_ref( method(:product_blacklist_handler), "map (map)" ), :hardware_handler => fun_ref( method(:hardware_handler_handler), "map (map)" ) } @check_handlers = { :polling_interval => fun_ref( method(:check_polling_interval), "map (map)" ), :udev_dir => fun_ref(method(:check_udev_dir), "map (map)"), :selector => fun_ref(method(:check_selector), "map (map)"), :path_selector => fun_ref( method(:check_path_selector), "map (map)" ), :path_grouping_policy => fun_ref(method(:check_path_gp), "map (map)"), :getuid_callout => fun_ref( method(:check_getuid_callout), "map (map)" ), :prio_callout => fun_ref( method(:check_prio_callout), "map (map)" ), :features => fun_ref(method(:check_features), "map (map)"), :path_checker => fun_ref( method(:check_path_checker), "map (map)" ), :failback => fun_ref(method(:check_failback), "map (map)"), :rr_min_io => fun_ref(method(:check_rr_min_io), "map (map)"), :rr_weight => fun_ref(method(:check_rr_weight), "map (map)"), :no_path_retry => fun_ref( method(:check_no_path_retry), "map (map)" ), :user_friendly_names => fun_ref( method(:check_user_friendly_names), "map (map)" ), :wwid => fun_ref(method(:check_wwid), "map (map)"), :devnode => fun_ref(method(:check_devnode), "map (map)"), :alias => fun_ref(method(:check_alias), "map (map)"), :vendor => fun_ref(method(:check_vendor), "map (map)"), :product => fun_ref(method(:check_product), "map (map)"), :product_blacklist => fun_ref( method(:check_product_blacklist), "map (map)" ), :hardware_handler => fun_ref( method(:check_hardware_handler), "map (map)" ) } @multipath_detail_items = [ :path_grouping_policy, :path_checker, :path_selector, :failback, :no_path_retry, :rr_min_io ] @multipath_brief_items = [:wwid, :alias] @defaults_section_items = [ :polling_interval, :udev_dir, :selector, :path_grouping_policy, :getuid_callout, :prio_callout, :features, :path_checker, :path_selector, :failback, :rr_min_io, :rr_weight, :no_path_retry, :user_friendly_names ] @device_detail_items = [ :hardware_handler, :path_grouping_policy, :getuid_callout, :path_selector, :path_checker, :features, :prio_callout, :failback, :rr_weight, :no_path_retry, :rr_min_io ] @device_brief_items = [:vendor, :product, :product_blacklist] @blacklist_section_items = [:wwid, :devnode, :vendor, :product] end |
- (Object) no_path_retry_handler(item)
1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 |
# File '../../src/include/multipath/options.rb', line 1868 def no_path_retry_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:no_path_retry), :Value) if ret == :fail UI.ReplaceWidget( Id(:replace_no_path_retry), build_no_path_retry_term(:combobox_only) ) UI.ChangeWidget(Id(:no_path_retry), :Value, :fail) value = "fail" elsif ret == :queue UI.ReplaceWidget( Id(:replace_no_path_retry), build_no_path_retry_term(:combobox_only) ) UI.ChangeWidget(Id(:no_path_retry), :Value, :queue) value = "queue" elsif ret == :customized_str value = Ops.get_string(@temp_string_values, "no_path_retry", "") UI.ReplaceWidget( Id(:replace_no_path_retry), build_no_path_retry_term(:editable_combobox_only) ) UI.ChangeWidget( Id(:no_path_retry), :ValidChars, build_valid_chars("number") ) UI.ChangeWidget(Id(:no_path_retry), :Value, value) UI.SetFocus(Id(:no_path_retry)) @replacewidget_notify = true elsif ret == "" UI.ReplaceWidget( Id(:replace_no_path_retry), build_no_path_retry_term(:editable_combobox_only) ) UI.ChangeWidget( Id(:no_path_retry), :ValidChars, build_valid_chars("number") ) UI.SetFocus(Id(:no_path_retry)) UI.ChangeWidget(Id(:no_path_retry), :Value, "") value = "" Ops.set(@temp_string_values, "no_path_retry", value) @replacewidget_notify = true elsif Builtins.tointeger(ret) != nil value = Convert.to_string(ret) Ops.set(@temp_string_values, "no_path_retry", value) else Popup.Message( Builtins.sformat("no_path_retry_handler: unexpected ret %1", ret) ) end Ops.set(item, "no_path_retry", value) deep_copy(item) end |
- (Object) path_checker_handler(item)
1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 |
# File '../../src/include/multipath/options.rb', line 1498 def path_checker_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:path_checker), :Value) if ret == :none value = "" elsif ret == :readsector0 value = "readsector0" elsif ret == :tur value = "tur" elsif ret == :emc_clariion value = "emc_clariion" elsif ret == :hp_sw value = "hp_sw" elsif ret == :rdac value = "rdac" elsif ret == :directio value = "directio" else Popup.Message( Builtins.sformat("path_checker_handler: unexpected ret %1", ret) ) end Ops.set(item, "path_checker", value) deep_copy(item) end |
- (Object) path_gp_handler(item)
1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 |
# File '../../src/include/multipath/options.rb', line 1116 def path_gp_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:path_grouping_policy), :Value) if ret == :none value = "" elsif ret == :failover value = "failover" elsif ret == :multibus value = "multibus" elsif ret == :group_by_serial value = "group_by_serial" elsif ret == :group_by_prio value = "group_by_prio" elsif ret == :group_by_node_name value = "group_by_node_name" else Popup.Message( Builtins.sformat("path_gp_handler: unexpected ret %1", ret) ) end Ops.set(item, "path_grouping_policy", value) deep_copy(item) end |
- (Object) path_selector_handler(item)
1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 |
# File '../../src/include/multipath/options.rb', line 1049 def path_selector_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:path_selector), :Value) if ret == :round_robin value = "round-robin 0" elsif ret == :service_time value = "service-time 0" elsif ret == :queue_length value = "queue-length 0" elsif ret == :none value = "" else Popup.Message( Builtins.sformat("path_selector_handler: unexpected ret %1", ret) ) end Ops.set(item, "path_selector", value) deep_copy(item) end |
- (Object) polling_interval_handler(item)
805 806 807 808 809 810 811 812 813 814 815 816 817 818 |
# File '../../src/include/multipath/options.rb', line 805 def polling_interval_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:polling_interval), :Value) if Ops.is_string?(ret) == true value = Convert.to_string(ret) else Popup.Message( Builtins.sformat("polling_interval_handler: unexpectd ret %1", ret) ) end Ops.set(item, "polling_interval", value) deep_copy(item) end |
- (Object) prio_callout_handler(item)
1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 |
# File '../../src/include/multipath/options.rb', line 1332 def prio_callout_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:prio_callout), :Value) if ret == :prio_emc value = "mpath_prio_emc /dev/%n" elsif ret == :prio_alua value = "mpath_prio_alua /dev/%n" elsif ret == :prio_netapp value = "mpath_prio_netapp /dev/%n" elsif ret == :prio_tpc value = "mpath_prio_tpc /dev/%n" elsif ret == :prio_hp_sw value = "mpath_prio_hp_sw /dev/%n" elsif ret == :prio_hds_mod value = "mpath_prio_hds_modular %b" elsif ret == :none value = "" else Popup.Message( Builtins.sformat("prio_callout_handler: unexpected ret %1", ret) ) end Ops.set(item, "prio_callout", value) deep_copy(item) end |
- (Object) product_blacklist_handler(item)
2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 |
# File '../../src/include/multipath/options.rb', line 2313 def product_blacklist_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:product_blacklist), :Value) if Ops.is_string?(ret) == true value = Convert.to_string(ret) else Popup.Message( Builtins.sformat("product_blacklist_handler: unexpected ret %1", ret) ) end Ops.set(item, "product_blacklist", value) deep_copy(item) end |
- (Object) product_handler(item)
2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 |
# File '../../src/include/multipath/options.rb', line 2253 def product_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:product), :Value) if Ops.is_string?(ret) == true value = Convert.to_string(ret) else Popup.Message( Builtins.sformat("product_handler: unexpected ret %1", ret) ) end Ops.set(item, "product", value) deep_copy(item) end |
- (Object) rm_quotes(value)
remove all the quotes at head and end. ignore quotes in the be middle of value
690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 |
# File '../../src/include/multipath/options.rb', line 690 def rm_quotes(value) str_len = 0 str_start = 0 str_end = 0 str_len = Builtins.size(value) return "" if Ops.less_or_equal(str_len, 0) str_end = Ops.subtract(str_len, 1) while Ops.less_than(str_start, str_len) cur_char = Builtins.substring(value, str_start, 1) if cur_char == " " || cur_char == "\t" || cur_char == "\r" || cur_char == "\n" || cur_char == "\"" str_start = Ops.add(str_start, 1) next end break end while Ops.greater_than(str_end, str_start) cur_char = Builtins.substring(value, str_end, 1) if cur_char == " " || cur_char == "\t" || cur_char == "\r" || cur_char == "\n" || cur_char == "\"" str_end = Ops.subtract(str_end, 1) next end break end result = "" if Ops.greater_or_equal(str_end, str_start) result = Builtins.substring( value, str_start, Ops.add(Ops.subtract(str_end, str_start), 1) ) end result end |
- (Object) rr_min_io_handler(item)
1708 1709 1710 1711 1712 1713 1714 1715 |
# File '../../src/include/multipath/options.rb', line 1708 def rr_min_io_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:rr_min_io), :Value) value = Convert.to_string(ret) if Builtins.tointeger(ret) != nil Ops.set(item, "rr_min_io", value) deep_copy(item) end |
- (Object) rr_weight_handler(item)
1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 |
# File '../../src/include/multipath/options.rb', line 1776 def rr_weight_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:rr_weight), :Value) if ret == :priorities value = "priorities" elsif ret == :uniform value = "uniform" elsif ret == :none value = "" else Popup.Message( Builtins.sformat("rr_weight_handler: unexpected ret %1", ret) ) end Ops.set(item, "rr_weight", value) deep_copy(item) end |
- (Object) selector_handler(item)
963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 |
# File '../../src/include/multipath/options.rb', line 963 def selector_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:selector), :Value) if ret == :round_robin value = "round-robin 0" elsif ret == :service_time value = "service-time 0" elsif ret == :queue_length value = "queue-length 0" elsif ret == :none value = "" else Popup.Message( Builtins.sformat("selector_handler: unexpected ret %1", ret) ) end Ops.set(item, "selector", value) deep_copy(item) end |
- (Object) udev_dir_handler(item)
885 886 887 888 889 890 891 892 893 894 895 896 897 898 |
# File '../../src/include/multipath/options.rb', line 885 def udev_dir_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:udev_dir), :Value) if Ops.is_string?(ret) value = Convert.to_string(ret) else Popup.Message( Builtins.sformat("udev_dir_handler: unexpected ret %1", ret) ) end Ops.set(item, "udev_dir", value) deep_copy(item) end |
- (Object) update_alias_term(item)
2140 2141 2142 2143 2144 2145 2146 2147 |
# File '../../src/include/multipath/options.rb', line 2140 def update_alias_term(item) item = deep_copy(item) value = Ops.get_string(item, "alias", "") UI.ChangeWidget(Id(:alias), :ValidChars, build_valid_chars("alias")) UI.ChangeWidget(Id(:alias), :Value, value) nil end |
- (Object) update_devnode_term(item)
2084 2085 2086 2087 2088 2089 2090 2091 |
# File '../../src/include/multipath/options.rb', line 2084 def update_devnode_term(item) item = deep_copy(item) value = Ops.get_string(item, "devnode", "") UI.ChangeWidget(Id(:devnode), :ValidChars, build_valid_chars("devnode")) UI.ChangeWidget(Id(:devnode), :Value, value) nil end |
- (Object) update_failback_term(item)
1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 |
# File '../../src/include/multipath/options.rb', line 1578 def update_failback_term(item) item = deep_copy(item) value = Ops.get_string(item, "failback", "") if value == "manual" UI.ChangeWidget(Id(:failback), :Value, :manual) elsif value == "immediate" UI.ChangeWidget(Id(:failback), :Value, :immediate) else UI.ReplaceWidget( Id(:replace_failback), build_failback_term(:editable_combobox_only) ) UI.ChangeWidget(Id(:failback), :ValidChars, build_valid_chars("number")) UI.ChangeWidget(Id(:failback), :Value, value) Ops.set(@temp_string_values, "failback", value) end nil end |
- (Object) update_features_term(item)
1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 |
# File '../../src/include/multipath/options.rb', line 1389 def update_features_term(item) item = deep_copy(item) value = Ops.get_string(item, "features", "") if value == "1 queue_if_no_path" UI.ChangeWidget(Id(:features), :Value, :queue_if_no_path) elsif value == "0" UI.ChangeWidget(Id(:features), :Value, :zero) elsif value == "" UI.ChangeWidget(Id(:features), :Value, :none) else Popup.Message( Builtins.sformat("update_features_term: unexpected value %1", value) ) end nil end |
- (Object) update_getuid_callout_term(item)
1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 |
# File '../../src/include/multipath/options.rb', line 1196 def update_getuid_callout_term(item) item = deep_copy(item) value = Ops.get_string(item, "getuid_callout", "") if value == "/sbin/scsi_id -g -u -s" UI.ChangeWidget(Id(:getuid_callout), :Value, :default) else UI.ReplaceWidget( Id(:replace_getuid_callout), build_getuid_callout_term(:editable_combobox_only) ) UI.ChangeWidget( Id(:getuid_callout), :ValidChars, build_valid_chars("path") ) UI.ChangeWidget(Id(:getuid_callout), :Value, value) UI.SetFocus(Id(:getuid_callout)) end nil end |
- (Object) update_hardware_handler_term(item)
2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 |
# File '../../src/include/multipath/options.rb', line 2356 def update_hardware_handler_term(item) item = deep_copy(item) value = Ops.get_string(item, "hardware_handler", "") UI.ChangeWidget( Id(:hardware_handler), :ValidChars, build_valid_chars("hardware_handler") ) UI.ChangeWidget(Id(:hardware_handler), :Value, value) nil end |
- (Object) update_no_path_retry_term(item)
1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 |
# File '../../src/include/multipath/options.rb', line 1844 def update_no_path_retry_term(item) item = deep_copy(item) value = Ops.get_string(item, "no_path_retry", "") if value == "fail" UI.ChangeWidget(Id(:no_path_retry), :Value, :fail) elsif value == "queue" UI.ChangeWidget(Id(:no_path_retry), :Value, :queue) else UI.ReplaceWidget( Id(:replace_no_path_retry), build_no_path_retry_term(:editable_combobox_only) ) UI.ChangeWidget( Id(:no_path_retry), :ValidChars, build_valid_chars("number") ) UI.ChangeWidget(Id(:no_path_retry), :Value, value) Ops.set(@temp_string_values, "no_path_retry", value) end nil end |
- (Object) update_path_checker_term(item)
1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 |
# File '../../src/include/multipath/options.rb', line 1469 def update_path_checker_term(item) item = deep_copy(item) value = Ops.get_string(item, "path_checker", "") if value == "readsector0" UI.ChangeWidget(Id(:path_checker), :Value, :readsector0) elsif value == "tur" UI.ChangeWidget(Id(:path_checker), :Value, :tur) elsif value == "emc_clariion" UI.ChangeWidget(Id(:path_checker), :Value, :emc_clariion) elsif value == "hp_sw" UI.ChangeWidget(Id(:path_checker), :Value, :hp_sw) elsif value == "rdac" UI.ChangeWidget(Id(:path_checker), :Value, :rdac) elsif value == "directio" UI.ChangeWidget(Id(:path_checker), :Value, :directio) elsif value == "" UI.ChangeWidget(Id(:path_checker), :Value, :none) else Popup.Message( Builtins.sformat( "update_path_checker_term: unexpected value %1", value ) ) end nil end |
- (Object) update_path_gp_term(item)
1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 |
# File '../../src/include/multipath/options.rb', line 1093 def update_path_gp_term(item) item = deep_copy(item) value = "" id = "" value = Ops.get_string(item, "path_grouping_policy", "") if value == "failover" UI.ChangeWidget(Id(:path_grouping_policy), :Value, :failover) elsif value == "multibus" UI.ChangeWidget(Id(:path_grouping_policy), :Value, :multibus) elsif value == "group_by_serial" UI.ChangeWidget(Id(:path_grouping_policy), :Value, :group_by_serial) elsif value == "group_by_prio" UI.ChangeWidget(Id(:path_grouping_policy), :Value, :group_by_prio) elsif value == "group_by_node_name" UI.ChangeWidget(Id(:path_grouping_policy), :Value, :group_by_node_name) else UI.ChangeWidget(Id(:path_grouping_policy), :Value, :none) end nil end |
- (Object) update_path_selector_term(item)
1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 |
# File '../../src/include/multipath/options.rb', line 1026 def update_path_selector_term(item) item = deep_copy(item) value = Ops.get_string(item, "path_selector", "") if value == "round-robin 0" UI.ChangeWidget(Id(:path_selector), :Value, :round_robin) elsif value == "service-time 0" UI.ChangeWidget(Id(:path_selector), :Value, :service_time) elsif value == "queue-length 0" UI.ChangeWidget(Id(:path_selector), :Value, :queue_length) elsif value == "" UI.ChangeWidget(Id(:path_selector), :Value, :none) else Popup.Message( Builtins.sformat( "update_path_selector_term: unexpected value %1", value ) ) end nil end |
- (Object) update_polling_interval_term(item)
792 793 794 795 796 797 798 799 800 801 802 803 |
# File '../../src/include/multipath/options.rb', line 792 def update_polling_interval_term(item) item = deep_copy(item) value = Ops.get_string(item, "polling_interval", "") UI.ChangeWidget( Id(:polling_interval), :ValidChars, build_valid_chars("number") ) UI.ChangeWidget(Id(:polling_interval), :Value, value) nil end |
- (Object) update_prio_callout_term(item)
1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 |
# File '../../src/include/multipath/options.rb', line 1303 def update_prio_callout_term(item) item = deep_copy(item) value = Ops.get_string(item, "prio_callout", "") if value == "mpath_prio_emc /dev/%n" UI.ChangeWidget(Id(:prio_callout), :Value, :prio_emc) elsif value == "mpath_prio_alua /dev/%n" UI.ChangeWidget(Id(:prio_callout), :Value, :prio_alua) elsif value == "mpath_prio_netapp /dev/%n" UI.ChangeWidget(Id(:prio_callout), :Value, :prio_netapp) elsif value == "mpath_prio_tpc /dev/%n" UI.ChangeWidget(Id(:prio_callout), :Value, :prio_tpc) elsif value == "mpath_prio_hp_sw /dev/%n" UI.ChangeWidget(Id(:prio_callout), :Value, :prio_hp_sw) elsif value == "mpath_prio_hds_modular %b" UI.ChangeWidget(Id(:prio_callout), :Value, :prio_hds_mod) elsif value == "" UI.ChangeWidget(Id(:prio_callout), :Value, :none) else Popup.Message( Builtins.sformat( "update_prio_callout_term: unexpected value %1", value ) ) end nil end |
- (Object) update_product_blacklist_term(item)
2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 |
# File '../../src/include/multipath/options.rb', line 2300 def update_product_blacklist_term(item) item = deep_copy(item) value = Ops.get_string(item, "product_blacklist", "") UI.ChangeWidget( Id(:product_blacklist), :ValidChars, build_valid_chars("product_blacklist") ) UI.ChangeWidget(Id(:product_blacklist), :Value, value) nil end |
- (Object) update_product_term(item)
2245 2246 2247 2248 2249 2250 2251 |
# File '../../src/include/multipath/options.rb', line 2245 def update_product_term(item) item = deep_copy(item) value = Ops.get_string(item, "product", "") UI.ChangeWidget(Id(:product), :ValidChars, build_valid_chars("product")) UI.ChangeWidget(Id(:product), :Value, value) nil end |
- (Object) update_rr_min_io_term(item)
1699 1700 1701 1702 1703 1704 1705 1706 |
# File '../../src/include/multipath/options.rb', line 1699 def update_rr_min_io_term(item) item = deep_copy(item) value = Ops.get_string(item, "rr_min_io", "") UI.ChangeWidget(Id(:rr_min_io), :ValidChars, build_valid_chars("number")) UI.ChangeWidget(Id(:rr_min_io), :Value, value) nil end |
- (Object) update_rr_weight_term(item)
1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 |
# File '../../src/include/multipath/options.rb', line 1758 def update_rr_weight_term(item) item = deep_copy(item) value = Ops.get_string(item, "rr_weight", "") if value == "priorities" UI.ChangeWidget(Id(:rr_weight), :Value, :priorities) elsif value == "uniform" UI.ChangeWidget(Id(:rr_weight), :Value, :uniform) elsif value == "" UI.ChangeWidget(Id(:rr_weight), :Value, :none) else Popup.Message( Builtins.sformat("update_rr_weight_term: unexpected value %1", value) ) end nil end |
- (Object) update_selector_term(item)
943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 |
# File '../../src/include/multipath/options.rb', line 943 def update_selector_term(item) item = deep_copy(item) value = Ops.get_string(item, "selector", "") if value == "round-robin 0" UI.ChangeWidget(Id(:selector), :Value, :round_robin) elsif value == "service-time 0" UI.ChangeWidget(Id(:selector), :Value, :service_time) elsif value == "queue-length 0" UI.ChangeWidget(Id(:selector), :Value, :queue_length) elsif value == "" UI.ChangeWidget(Id(:selector), :Value, :none) else Popup.Message( Builtins.sformat("update_selector_term: unexpected value %1", value) ) end nil end |
- (Object) update_udev_dir_term(item)
876 877 878 879 880 881 882 883 |
# File '../../src/include/multipath/options.rb', line 876 def update_udev_dir_term(item) item = deep_copy(item) value = Ops.get_string(item, "udev_dir", "") UI.ChangeWidget(Id(:udev_dir), :ValidChars, build_valid_chars("path")) UI.ChangeWidget(Id(:udev_dir), :Value, value) nil end |
- (Object) update_user_friendly_names_term(item)
1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 |
# File '../../src/include/multipath/options.rb', line 1964 def update_user_friendly_names_term(item) item = deep_copy(item) value = Ops.get_string(item, "user_friendly_names", "") if value == "yes" UI.ChangeWidget(Id(:user_friendly_names), :Value, :yes) elsif value == "no" UI.ChangeWidget(Id(:user_friendly_names), :Value, :no) elsif value == "" UI.ChangeWidget(Id(:user_friendly_names), :Value, :none) else Popup.Message( Builtins.sformat( "update_user_friendly_names_term: unexpected value %1", value ) ) end nil end |
- (Object) update_vendor_term(item)
2189 2190 2191 2192 2193 2194 2195 2196 |
# File '../../src/include/multipath/options.rb', line 2189 def update_vendor_term(item) item = deep_copy(item) value = Ops.get_string(item, "vendor", "") UI.ChangeWidget(Id(:vendor), :ValidChars, build_valid_chars("vendor")) UI.ChangeWidget(Id(:vendor), :Value, value) nil end |
- (Object) update_wwid_term(item)
2035 2036 2037 2038 2039 2040 2041 2042 |
# File '../../src/include/multipath/options.rb', line 2035 def update_wwid_term(item) item = deep_copy(item) value = Ops.get_string(item, "wwid", "") UI.ChangeWidget(Id(:wwid), :ValidChars, build_valid_chars("wwid")) UI.ChangeWidget(Id(:wwid), :Value, value) nil end |
- (Object) user_friendly_names_handler(item)
1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 |
# File '../../src/include/multipath/options.rb', line 1985 def user_friendly_names_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:user_friendly_names), :Value) if ret == :yes value = "yes" elsif ret == :no value = "no" elsif ret == :none value = "" else Popup.Message( Builtins.sformat( "user_friendly_names_handler: unexpected ret %1", ret ) ) end Ops.set(item, "user_friendly_names", value) deep_copy(item) end |
- (Object) vendor_handler(item)
2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 |
# File '../../src/include/multipath/options.rb', line 2198 def vendor_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:vendor), :Value) if Ops.is_string?(ret) == true value = Convert.to_string(ret) else Popup.Message( Builtins.sformat("vendor_handler: unexpected ret %1", ret) ) end Ops.set(item, "vendor", value) deep_copy(item) end |
- (Object) wwid_handler(item)
2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 |
# File '../../src/include/multipath/options.rb', line 2044 def wwid_handler(item) item = deep_copy(item) value = "" ret = UI.QueryWidget(Id(:wwid), :Value) if Ops.is_string?(ret) == true value = Convert.to_string(ret) else Popup.Message(Builtins.sformat("wwid_handler: unexpected ret %1", ret)) end Ops.set(item, "wwid", value) deep_copy(item) end |