Skip to content

FEATURE: STACKI-1631 Remove ifconfig and replace with ip #845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions common/src/stack/pylib/stack/wizard.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /opt/stack/bin/python
#
# @copyright@
# Copyright (c) 2006 - 2019 Teradata
# Copyright (c) 2006 - 2020 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
Expand All @@ -16,7 +16,6 @@
import socket
from xml.etree.ElementTree import Element, SubElement, ElementTree


class Attr:
Info_FQDN = ""
Kickstart_Keyboard = "us"
Expand Down Expand Up @@ -131,10 +130,11 @@ def setNetwork(self, interface, mac, addr, netmask):
if os.path.exists(ifDhcpFile):
os.remove(ifDhcpFile)
# Force network reconfiguration
cmd = ['/sbin/ifconfig', interface, addr, 'netmask', netmask]
ip_mask = ipaddress.ip_interface(join(addr,'/',netmask))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this join function coming from? The syntax for joining a string together with join is:
'\'.join([addr, netmask]). I believe this would throw a NameError exception. Which means your test is likely not causing this code to run.

I looked at last night's coverage report, and the setNetwork function isn't being called by any of the tests in develop. So, it is possible that setNetwork is dead code. You'll need to trace it down and see if anything calls it.

Also: You can get a coverage report for your own branch by either adding _cov to the end of your branch name or by putting the work coverage in the last commit message.

cmd = ['/sbin/ip', 'addr', 'add', ip_mask.with_prefixlen, 'dev', interface]
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
# Bring up network
cmd = ['/sbin/ifconfig', interface, 'up']
cmd = ['/sbin/ip', 'link', 'set', interface, 'up']
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)

def setHostname(self, hostname):
Expand Down