def test_get_connection_list(self): """Check that we can get a list of available connections.""" connections = network.get_connection_list() self.assertTrue("plinth_test_eth" in [x["name"] for x in connections]) self.assertTrue("plinth_test_wifi" in [x["name"] for x in connections]) self.assertTrue("plinth_test_pppoe" in [x["name"] for x in connections])
def get_context_data(self, **kwargs): """Add network connections to context list.""" context = super().get_context_data(**kwargs) context['connections'] = network.get_connection_list() context['title'] = _('Setup Complete') context['firstboot_complete'] = True return context
def test_get_connection_list(self): """Check that we can get a list of available connections.""" connections = network.get_connection_list() self.assertTrue('plinth_test_eth' in [x['name'] for x in connections]) self.assertTrue('plinth_test_wifi' in [x['name'] for x in connections]) self.assertTrue('plinth_test_pppoe' in [x['name'] for x in connections])
def index(request): """Show connection list.""" connections = network.get_connection_list() return TemplateResponse(request, 'connections_list.html', {'title': _('Network Connections'), 'subsubmenu': subsubmenu, 'connections': connections})
def index(request): """Show connection list.""" connections = network.get_connection_list() return TemplateResponse( request, "connections_list.html", {"title": _("Network Connections"), "subsubmenu": subsubmenu, "connections": connections}, )
def state10(request): """State 10 is when all firstboot setup is done. After viewing this page the firstboot module can't be accessed anymore. """ # Make sure that a user exists before finishing firstboot if User.objects.all(): kvstore.set('firstboot_state', 10) connections = network.get_connection_list() return render(request, 'firstboot_state10.html', {'title': _('Setup Complete'), 'connections': connections})
def state10(request): """State 10 is when all firstboot setup is done. After viewing this page the firstboot module can't be accessed anymore. """ # Make sure that a user exists before finishing firstboot if User.objects.all(): kvstore.set('firstboot_state', 10) connections = network.get_connection_list() return render(request, 'firstboot_state10.html', { 'title': _('Setup Complete'), 'connections': connections })
def index(request): """Show connection list.""" connections = network.get_connection_list() internet_connection_type = kvstore.get_default( networks.INTERNET_CONNECTION_TYPE_KEY, 'unknown') return TemplateResponse( request, 'networks_configuration.html', { 'app_id': 'networks', 'app_info': networks.app.info, 'title': _('Network Connections'), 'has_diagnostics': True, 'is_enabled': True, 'connections': connections, 'internet_connectivity_type': internet_connection_type })
def index(request): """Show connection list.""" connections = network.get_connection_list() network_topology_type = networks.get_network_topology_type() internet_connection_type = networks.get_internet_connection_type() return TemplateResponse( request, 'networks_configuration.html', { 'app_id': 'networks', 'app_info': networks.app.info, 'title': _('Network Connections'), 'has_diagnostics': True, 'is_enabled': True, 'connections': connections, 'network_topology': network_topology_type, 'internet_connectivity_type': internet_connection_type, })
def _get_shared_interfaces(): """Get active network interfaces in shared mode.""" shared_interfaces = [] for connection in network.get_connection_list(): if not connection['is_active']: continue connection_uuid = connection['uuid'] connection = network.get_connection(connection_uuid) settings_ipv4 = connection.get_setting_ip4_config() if settings_ipv4.get_method() == 'shared': settings_connection = connection.get_setting_connection() interface = settings_connection.get_interface_name() if interface: shared_interfaces.append(interface) return shared_interfaces
def test_get_connection_list(self): """Check that we can get a list of available connections.""" connections = network.get_connection_list() self.assertTrue('plinth_test_eth' in [x['name'] for x in connections]) self.assertTrue('plinth_test_wifi' in [x['name'] for x in connections])