Add network connection: Show current IP address when editing a connection

- Added some generic network helper functions to global network helper class
  to get some information from a device by it's name. This is used when editing
  a connection (no ip was shown before).

- ToDo:
  This is only a workaround because we want to get the information from the connection but not from the device
  which belongs to the connection. If multiple connections are setup on the same device, this workaround will not
  work anymore.
This commit is contained in:
Daniel Steglich 2015-09-21 21:39:20 +02:00 committed by Sunil Mohan Adapa
parent c3e5753b52
commit f49def2d39

View File

@ -204,11 +204,8 @@ def edit(request, uuid):
settings_ipv4 = connection.get_setting_ip4_config()
form_data['ipv4_method'] = settings_ipv4.get_method()
if settings_ipv4.get_num_addresses():
# XXX: Plinth crashes here. Possibly because a double free bug
# address = settings_ipv4.get_address(0)
# form_data['ipv4_address'] = address.get_address()
pass
name = connection.get_interface_name()
form_data['ipv4_address'] = network.get_ip_from_device(name)
if settings_connection.get_connection_type() == '802-11-wireless':
settings_wireless = connection.get_setting_wireless()