Skip to content

Commit f447a68

Browse files
committed
(in progress)
1 parent ea70f0c commit f447a68

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

zvmsdk/dist.py

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -681,9 +681,6 @@ class rhcos4(rhcos):
681681

682682

683683
class sles(LinuxDist):
684-
def _get_network_file_path(self):
685-
return '/etc/sysconfig/network/'
686-
687684
def _get_cfg_str(self, device, broadcast_v4, gateway_v4, ip_v4,
688685
netmask_v4, address_read, subchannels, dns_v4, mtu):
689686
cfg_str = "BOOTPROTO=\'static\'\n"
@@ -717,12 +714,6 @@ def _get_cmd_str(self, address_read, address_write, address_data):
717714
def _get_dns_filename(self):
718715
return '/etc/resolv.conf'
719716

720-
def _get_device_filename(self, vdev):
721-
return 'ifcfg-eth' + str(vdev).zfill(4)
722-
723-
def _get_all_device_filename(self):
724-
return 'ifcfg-eth*'
725-
726717
def _get_device_name(self, vdev):
727718
return 'eth' + str(vdev).zfill(4)
728719

@@ -889,6 +880,15 @@ def get_volume_detach_configuration_cmds(self, fcp_list, target_wwpns,
889880

890881

891882
class sles12(sles):
883+
def _get_network_file_path(self):
884+
return '/etc/sysconfig/network/'
885+
886+
def _get_device_filename(self, vdev):
887+
return 'ifcfg-eth' + str(vdev).zfill(4)
888+
889+
def _get_all_device_filename(self):
890+
return 'ifcfg-eth*'
891+
892892
def get_znetconfig_contents(self):
893893
remove_route = 'rm -f %s/ifroute-eth*' % self._get_network_file_path()
894894
return '\n'.join(('cio_ignore -R',
@@ -978,7 +978,25 @@ def get_znetconfig_contents(self):
978978

979979
class sles16(sles):
980980
# TODO: ADD MODERN DISTRIBUTIONS
981-
pass
981+
def _get_network_file_path(self):
982+
return '/etc/NetworkManager/system-connections/'
983+
984+
def _get_device_filename(self, vdev):
985+
return 'eth' + str(vdev).zfill(4) + 'nmconnection'
986+
987+
def _get_all_device_filename(self):
988+
return 'eth*.nmconnection'
989+
990+
def get_znetconfig_contents(self):
991+
return '\n'.join(('cio_ignore -R',
992+
'znetconf -R -n',
993+
'sleep 2',
994+
'udevadm trigger',
995+
'udevadm settle',
996+
'sleep 2',
997+
'znetconf -A',
998+
'cio_ignore -u',
999+
'nmcli connection reload'))
9821000

9831001

9841002
class ubuntu(LinuxDist):

0 commit comments

Comments
 (0)