python-ifcfg icon indicating copy to clipboard operation
python-ifcfg copied to clipboard

PATH variable should be considered in Parser

Open mobangjack opened this issue 4 years ago • 1 comments

class UnixParser(Parser):

@classmethod
def get_command(cls):
    ifconfig_cmd = 'ifconfig'
    for path in ['/sbin', '/usr/sbin', '/bin', '/usr/bin']: // PATH variable should be considered
        if os.path.exists(os.path.join(path, ifconfig_cmd)):
            ifconfig_cmd = os.path.join(path, ifconfig_cmd)
            break
    ifconfig_cmd = ifconfig_cmd + " -a"
    return ifconfig_cmd

mobangjack avatar Sep 09 '21 02:09 mobangjack

Sounds like a great idea :+1:

You are welcome to look into this :+1:

benjaoming avatar Sep 13 '21 20:09 benjaoming