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 authored and Sunil Mohan Adapa committed 2015-10-11 16:28:55 +05:30
1 parent c3e5753b52
commit f49def2d39
1 file changed
+2 -5
+2 -5
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()