diff options
author | Chris Lumens <clumens@redhat.com> | 2008-10-14 14:21:09 -0400 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2008-10-14 14:21:09 -0400 |
commit | 54ec6004d7827601f075a7218969f3895fdc8700 (patch) | |
tree | e494e0cc41bec9055b0d351babba22e30bcd3268 /network.py | |
parent | 13ef1cee38273963bfc74315e7fcae2c460603e8 (diff) | |
download | anaconda-54ec6004d7827601f075a7218969f3895fdc8700.tar.gz anaconda-54ec6004d7827601f075a7218969f3895fdc8700.tar.xz anaconda-54ec6004d7827601f075a7218969f3895fdc8700.zip |
NM no longer provides the hostname as a property (#466775).
Diffstat (limited to 'network.py')
-rw-r--r-- | network.py | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/network.py b/network.py index 3cbffa183..1fa4d35db 100644 --- a/network.py +++ b/network.py @@ -71,42 +71,9 @@ def sanityCheckHostname(hostname): # Try to determine what the hostname should be for this system def getDefaultHostname(anaconda): - hn = None - bus = dbus.SystemBus() - nm = bus.get_object(isys.NM_SERVICE, isys.NM_MANAGER_PATH) - nm_props_iface = dbus.Interface(nm, isys.DBUS_PROPS_IFACE) - - active_connections = nm_props_iface.Get(isys.NM_MANAGER_IFACE, "ActiveConnections") - - # XXX: account for Ip6Config objects when NetworkManager supports them - for connection in active_connections: - active_connection = bus.get_object(isys.NM_SERVICE, connection) - active_connection_props_iface = dbus.Interface(active_connection, isys.DBUS_PROPS_IFACE) - devices = active_connection_props_iface.Get(isys.NM_MANAGER_IFACE, 'Devices') - - for device_path in devices: - device = bus.get_object(isys.NM_SERVICE, device_path) - device_props_iface = dbus.Interface(device, isys.DBUS_PROPS_IFACE) - - ip4_config_path = device_props_iface.Get(isys.NM_MANAGER_IFACE, 'Ip4Config') - ip4_config_obj = bus.get_object(isys.NM_SERVICE, ip4_config_path) - ip4_config_props = dbus.Interface(ip4_config_obj, isys.DBUS_PROPS_IFACE) - - domains = ip4_config_props.Get(isys.NM_MANAGER_IFACE, "Domains") - hostname = ip4_config_props.Get(isys.NM_MANAGER_IFACE, "Hostname") - - if len(domains) == 1: - hn = "%s.%s" % (hostname, domains[0],) - else: - hn = hostname - - if hn: - return hn - - # NetworkManager didn't give us a hostname, try to find it another way hn = anaconda.id.network.hostname - if hn == '' or hn == '(none)' or hn == 'localhost' or hn == 'localhost.localdomain': + if not hn or hn == '(none)' or hn == 'localhost' or hn == 'localhost.localdomain': hn = socket.gethostname() if hn == '(none)' or hn == 'localhost': |