diff --git a/pyanaconda/modules/network/nm_client.py b/pyanaconda/modules/network/nm_client.py index 94a1f6ef3722..b3cc35a24710 100644 --- a/pyanaconda/modules/network/nm_client.py +++ b/pyanaconda/modules/network/nm_client.py @@ -35,6 +35,7 @@ from pyanaconda.modules.network.utils import get_s390_settings, netmask2prefix, prefix2netmask from pyanaconda.modules.network.config_file import is_config_file_for_system from pyanaconda.core.dbus import SystemBus +from pyanaconda.core import util from pyanaconda.anaconda_loggers import get_module_logger log = get_module_logger(__name__) @@ -437,12 +438,6 @@ def _update_wired_connection_with_s390_settings(connection, s390cfg): if s390cfg['SUBCHANNELS']: subchannels = s390cfg['SUBCHANNELS'].split(",") s_wired.props.s390_subchannels = subchannels - if s390cfg['NETTYPE']: - s_wired.props.s390_nettype = s390cfg['NETTYPE'] - if s390cfg['OPTIONS']: - opts = s390cfg['OPTIONS'].split(" ") - opts_dict = {k: v for k, v in (o.split("=") for o in opts)} - s_wired.props.s390_options = opts_dict def _create_new_connection(network_data, device_name): @@ -1376,15 +1371,10 @@ def _get_dracut_znet_argument_from_connection(connection): argument = "" wired_setting = connection.get_setting_wired() if wired_setting and is_s390(): - nettype = wired_setting.get_s390_nettype() - # get_s390_subchannels() returns a list of subchannels - subchannels = wired_setting.get_s390_subchannels() - if nettype and subchannels: - argument = "rd.znet={},{}".format(nettype, ",".join(subchannels)) - options = wired_setting.get_property(NM.SETTING_WIRED_S390_OPTIONS) - if options: - options_string = ','.join("{}={}".format(key, val) for key, val in options.items()) - argument += ",{}".format(options_string) + devspec = util.execWithCapture("/lib/s390-tools/zdev-to-rd.znet", + ["persistent", + connection.get_interface_name()]).strip() + argument = "rd.znet={}".format(devspec) return argument diff --git a/pyanaconda/modules/network/utils.py b/pyanaconda/modules/network/utils.py index ec5c361f8370..710446870ec6 100644 --- a/pyanaconda/modules/network/utils.py +++ b/pyanaconda/modules/network/utils.py @@ -34,8 +34,6 @@ def get_s390_settings(devname): cfg = { 'SUBCHANNELS': '', - 'NETTYPE': '', - 'OPTIONS': '' } subchannels = [] @@ -45,23 +43,6 @@ def get_s390_settings(devname): return cfg cfg['SUBCHANNELS'] = ','.join(subchannels) - # Example of the ccw.conf file content: - # qeth,0.0.0900,0.0.0901,0.0.0902,layer2=0,portname=FOOBAR,portno=0 - # - # SUBCHANNELS="0.0.0900,0.0.0901,0.0.0902" - # NETTYPE="qeth" - # OPTIONS="layer2=1 portname=FOOBAR portno=0" - if not os.path.exists('/run/install/ccw.conf'): - return cfg - with open('/run/install/ccw.conf') as f: - # pylint: disable=redefined-outer-name - for line in f: - if cfg['SUBCHANNELS'] in line: - items = line.strip().split(',') - cfg['NETTYPE'] = items[0] - cfg['OPTIONS'] = " ".join(i for i in items[1:] if '=' in i) - break - return cfg