(ifname, addr, netmask)
Create configuration file at /etc/network/interfaces.d/
Create configuration file at /etc/network/interfaces.d/
Create configuration file at / etc / network / interfaces . d /
def _add_to_interfaces_d(ifname, addr, netmask):
    """Create configuration file at /etc/network/interfaces.d/"""
    if_dir = "/etc/network/interfaces.d/"
    cfg = ("iface {0} inet static\n"
           "    address {1}\n"
           "    netmask {2}\n").format(ifname, addr, netmask)
    fname = ifname + ".conf"
    path = os.path.join(if_dir, fname)

    if (runner.dry):
        util.fill_print("Create a file named {} at {} and add the "
                        "following to it:".format(fname, if_dir))
        print(cfg)
        return

    runner.create_file(cfg, path, root=True)
def _add_to_interfaces_d ( ifname , addr , netmask ) : if_dir = "/etc/network/interfaces.d/" cfg = ( "iface {0} inet static\n" "    address {1}\n" "    netmask {2}\n" ) . format ( ifname , addr , netmask ) fname = ifname + ".conf" path = os . path . join ( if_dir , fname ) if ( runner . dry ) : util . fill_print ( "Create a file named {} at {} and add the " "following to it:" . format ( fname , if_dir ) ) print ( cfg ) return runner . create_file ( cfg , path , root = True )