Skip to content

[th/lazy-import-pyte] steps/nmtui: import "pyte" module only when needed

Thomas Haller requested to merge th/lazy-import-pyte into main

We use pyte, but only at exactly one place. Import the module at the place where we need it, otherwise, also our unit tests end up importing the module -- and worse, having pyte becomes a dependency of the unit test.

RunTests

@RunTests:nmtui_bond_add_default_bond,nmtui_bond_add_custom_bond_mii,nmtui_bond_add_custom_bond_arp,nmtui_bond_add_connection_wo_autoconnect,nmtui_bond_activate_wo_autoconnect,nmtui_bond_activate_with_autoconnect,nmtui_bond_deactivate_connection,nmtui_bond_delete_connection_up,nmtui_bond_delete_connection_down,nmtui_bond_add_one_slave,nmtui_bond_add_many_slaves,nmtui_bond_over_ethernet_devices,nmtui_bond_infiniband_slaves,nmtui_bond_start_on_boot_with_one_slave_auto,nmtui_bond_add_mode_active_backup,nmtui_bond_add_mode_round_robin,nmtui_bond_add_mode_xor,nmtui_bond_add_mode_broadcast,nmtui_bond_add_mode_8023ad,nmtui_bond_add_mode_balance_tlb,nmtui_bond_add_mode_balance_alb,nmtui_bond_change_mode_ac_to_rr,nmtui_bridge_add_default_bridge,nmtui_bridge_add_custom_bridge,nmtui_bridge_add_connection_wo_autoconnect,nmtui_bridge_activate_wo_autoconnect,nmtui_bridge_activate_with_autoconnect,nmtui_bridge_deactivate_connection,nmtui_bridge_delete_connection_up,nmtui_bridge_delete_connection_down,nmtui_bridge_add_many_slaves,nmtui_bridge_over_ethernet_devices,nmtui_bridge_over_ethernet_devices_no_stp,nmtui_bridge_over_vlans,nmtui_bridge_over_vlans_no_stp,nmtui_bridge_custom_bridge_port,nmtui_bridge_over_ethernet_and_vlan,nmtui_ethernet_create_default_connection,nmtui_ethernet_create_device_bound_connection,nmtui_ethernet_create_connection_wo_autoconnect,nmtui_ethernet_activate_connection,nmtui_ethernet_activate_connection_specific_device,nmtui_ethernet_deactivate_connection,nmtui_ethernet_delete_connection_down,nmtui_ethernet_delete_connection_up,nmtui_ethernet_set_mtu,nmtui_ethernet_mac_spoofing,nmtui_ethernet_mac_removal,nmtui_ethernet_static_ipv4,nmtui_ethernet_static_ipv6,nmtui_ethernet_static_combined,nmtui_general_exit_nmtui,nmtui_general_open_edit_menu,nmtui_general_open_activation_menu,nmtui_general_open_hostname_dialog,nmtui_general_display_proper_hostname,nmtui_general_set_new_hostname,nmtui_general_active_connections_display,nmtui_general_realtime_refresh_edit_screen,nmtui_general_realtime_refresh_activate_screen_wo_autoconnect,nmtui_general_realtime_refresh_activate_screen,nmtui_dsl_create_default_connection,nmtui_general_show_orphaned_slaves,nmtui_general_activate_screen_no_connections,nmtui_inf_create_master_connection,nmtui_inf_create_port_connection,nmtui_inf_add_connection_wo_autoconnect,nmtui_inf_delete_connection,nmtui_inf_set_mtu,nmtui_inf_datagram_mode,nmtui_inf_connected_mode,nmtui_ipv4_addresses_static_no_address,nmtui_ipv4_addresses_static_no_mask,nmtui_ipv4_addresses_static_no_mask_var2,nmtui_ipv4_addresses_static_no_mask_var3,nmtui_ipv4_addresses_static_no_mask_var4,nmtui_ipv4_addresses_static_no_mask_var5,nmtui_ipv4_addresses_auto_with_manual,nmtui_ipv4_addresses_IP_slash_invalid_netmask,nmtui_ipv4_addresses_IP_slash_netmask_and_gateway_manual,nmtui_ipv4_addresses_several_IPs_slash_netmask_and_gateway_manual,nmtui_ipv4_addresses_several_IPs_slash_netmask_and_gateway_auto,nmtui_ipv4_addresses_delete_ip_and_back_to_auto,nmtui_ipv4_routes_set_basic_route,nmtui_ipv4_routes_remove_basic_route,nmtui_ipv4_routes_set_device_route,nmtui_ipv4_routes_several_default_routes_metrics,nmtui_ipv4_routes_set_invalid_route_destination,nmtui_ipv4_routes_set_invalid_route_hop,nmtui_ipv4_routes_set_unreachable_route,nmtui_ipv4_dns_method_static_+_IP_+_dns,nmtui_ipv4_dns_method_auto_+_dns,nmtui_ipv4_dns_add_dns_when_one_already_set,nmtui_ipv4_dns_method_auto_then_delete_all_dns,nmtui_ipv4_dns_search_add_dns_search,nmtui_ipv4_dns_search_remove_dns_search,nmtui_ipv4_method_link_local,nmtui_ipv4_may_connection_required,nmtui_ipv4_may_connection_not_required,nmtui_ipv4_method_disabled,nmtui_ipv4_never_default_unset,nmtui_ipv4_never_default_set,nmtui_ipv4_invalid_address,nmtui_ipv4_invalid_gateway,nmtui_ipv4_invalid_dns,nmtui_ipv4_addresses_gateway_ip_prefix_nonzero_form,nmtui_ipv4_addresses_can_add_after_removing_invalid,nmtui_ipv4_addresses_gateway_ip_prefix_nonzero_form,nmtui_ipv6_addresses_static_no_address,nmtui_ipv6_addresses_static_no_mask,nmtui_ipv6_addresses_static_with_mask,nmtui_ipv6_addresses_auto_with_manual,nmtui_ipv6_addresses_IP_slash_invalid_netmask,nmtui_ipv6_addresses_IP_slash_netmask_and_gateway_manual,nmtui_ipv6_addresses_several_IPs_slash_netmask_and_gateway_manual,nmtui_ipv6_addresses_several_IPs_slash_netmask_and_gateway_auto,nmtui_ipv6_addresses_delete_ip_and_back_to_auto,nmtui_ipv6_routes_set_basic_route,nmtui_ipv6_routes_remove_basic_route,nmtui_ipv6_routes_set_device_route,nmtui_ipv6_routes_several_default_routes_metrics,nmtui_ipv6_routes_set_invalid_route_destination,nmtui_ipv6_routes_set_invalid_route_hop,nmtui_ipv6_dns_method_static_+_IP_+_dns,nmtui_ipv6_dns_method_auto_+_dns,nmtui_ipv6_dns_add_dns_when_one_already_set,nmtui_ipv6_dns_method_auto_then_delete_all_dns,nmtui_ipv6_dns_search_add_dns_search,nmtui_ipv6_dns_search_remove_dns_search,nmtui_ipv6_method_link_local,nmtui_ipv6_may_connection_required,nmtui_ipv6_may_connection_not_required,nmtui_ipv6_method_ignore,nmtui_ipv6_never_default_unset,nmtui_ipv6_never_default_set,nmtui_ipv6_invalid_address,nmtui_ipv6_invalid_gateway,nmtui_ipv6_invalid_dns,nmtui_ipv6_addresses_can_add_after_removing_invalid,nmtui_team_add_default_team,nmtui_team_add_connection_wo_autoconnect,nmtui_team_activate_wo_autoconnect,nmtui_team_activate_with_autoconnect,nmtui_team_deactivate_connection,nmtui_team_delete_connection_up,nmtui_team_delete_connection_down,nmtui_team_add_many_slaves,nmtui_team_over_ethernet_devices,nmtui_team_delete_slaves_after_deleting_profile,nmtui_team_infiniband_slaves,nmtui_team_slaves_non_auto,nmtui_team_boot_with_team_and_one_slave_auto,nmtui_team_json_set_loadbalance_mode,nmtui_team_json_set_broadcast_mode,nmtui_team_json_set_invalid_mode,nmtui_vlan_add_default_connection,nmtui_vlan_set_device,nmtui_vlan_missing_parent,nmtui_vlan_set_parent_as_device,nmtui_vlan_set_non_existant_parent,nmtui_vlan_autocompletion,nmtui_vlan_invalid_ids,nmtui_vlan_delete_connection_down,nmtui_vlan_delete_connection_activating,nmtui_vlan_delete_connection_up,nmtui_vlan_create_no_autoconnect,nmtui_vlan_activate_connection,nmtui_vlan_deactivate_connection_wo_autoconnect,nmtui_vlan_deactivate_connection_with_autoconnect,nmtui_vlan_change_id,nmtui_wifi_see_all_networks,nmtui_wifi_connect_to_open_network,nmtui_wifi_connect_to_wpa1psk_network,nmtui_wifi_connect_to_wpa2psk_network,nmtui_wifi_connect_to_wpa3psk_network,nmtui_wifi_add_default_connection_open_network,nmtui_wifi_ap,nmtui_wifi_wpa1,nmtui_wifi_wpa2,nmtui_wifi_wpa3,nmtui_wifi_wpa1_enterprise_tls,nmtui_wifi_wpa1_enterprise_peap_mschapv2,nmtui_wifi_wpa1_enterprise_ttls_mschapv2,nmtui_wifi_wpa2_enterprise_tls,nmtui_wifi_wpa2_enterprise_peap_mschapv2,nmtui_wifi_wpa2_enterprise_ttls_mschapv2,nmtui_simwifi_see_all_networks,nmtui_simwifi_connect_to_open_network,nmtui_simwifi_connect_to_wpa1psk_network,nmtui_simwifi_connect_to_wpa2psk_network,nmtui_simwifi_connect_to_wpa3psk_network,nmtui_simwifi_add_default_connection_open_network,nmtui_simwifi_fixed_device_present,nmtui_simwifi_fixed_device_invalid,nmtui_simwifi_autoconnect_off,nmtui_simwifi_activate_wo_autoconnect,nmtui_simwifi_activate_with_autoconnect,nmtui_simwifi_delete_connection_up,nmtui_simwifi_delete_connection_down,nmtui_simwifi_adhoc_network,nmtui_simwifi_ap,nmtui_simwifi_wrong_ssid,nmtui_simwifi_no_ssid,nmtui_simwifi_set_existing_bssid,nmtui_simwifi_set_nonexisting_bssid,nmtui_simwifi_bogus_bssid,nmtui_simwifi_mac_spoofing,nmtui_simwifi_connect_to_wep_hexkey_network,nmtui_simwifi_connect_to_wep_asciikey_network,nmtui_simwifi_wep_hexkey_connection,nmtui_simwifi_wep_ascii_connection,nmtui_simwifi_bogus_spoofing_address,nmtui_simwifi_mtu,nmtui_simwifi_wpa1_connection,nmtui_simwifi_wpa2_connection,nmtui_simwifi_wpa3_connection,nmtui_simwifi_show_password,nmtui_simwifi_connect_to_network_after_dismissal,nmtui_simwifi_teardown,wireguard_nmtui_doc_procedure

Edited by David Jaša

Merge request reports

Loading