Skip to content

Commit 70b5d60

Browse files
author
Meg M Kido
committed
FEATURE: STACKI-1631 no more ifconfig
1 parent 11e8d25 commit 70b5d60

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

common/src/stack/pylib/stack/wizard.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! /opt/stack/bin/python
22
#
33
# @copyright@
4-
# Copyright (c) 2006 - 2019 Teradata
4+
# Copyright (c) 2006 - 2020 Teradata
55
# All rights reserved. Stacki(r) v5.x stacki.com
66
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
77
# @copyright@
@@ -16,7 +16,6 @@
1616
import socket
1717
from xml.etree.ElementTree import Element, SubElement, ElementTree
1818

19-
2019
class Attr:
2120
Info_FQDN = ""
2221
Kickstart_Keyboard = "us"
@@ -131,10 +130,11 @@ def setNetwork(self, interface, mac, addr, netmask):
131130
if os.path.exists(ifDhcpFile):
132131
os.remove(ifDhcpFile)
133132
# Force network reconfiguration
134-
cmd = ['/sbin/ifconfig', interface, addr, 'netmask', netmask]
133+
ip_mask = ipaddress.ip_interface(join(addr,'/',netmask))
134+
cmd = ['/sbin/ip', 'addr', 'add', ip_mask.with_prefixlen, 'dev', interface]
135135
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
136136
# Bring up network
137-
cmd = ['/sbin/ifconfig', interface, 'up']
137+
cmd = ['/sbin/ip', 'link', 'set', interface, 'up']
138138
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
139139

140140
def setHostname(self, hostname):

0 commit comments

Comments
 (0)