(ifname, addr, netmask)
Create configuration file at /etc/sysconfig/network-scripts/
Create configuration file at /etc/sysconfig/network-scripts/
Create configuration file at / etc / sysconfig / network - scripts /
def _add_to_sysconfig_net_scripts(ifname, addr, netmask):
    """Create configuration file at /etc/sysconfig/network-scripts/"""
    cfg_dir = "/etc/sysconfig/network-scripts/"
    cfg = ("NM_CONTROLLED=\"yes\"\n"
           "DEVICE=\"{0}\"\n"
           "BOOTPROTO=none\n"
           "ONBOOT=\"no\"\n"
           "IPADDR={1}\n"
           "NETMASK={2}\n").format(ifname, addr, netmask)

    fname = "ifcfg-" + ifname
    path = os.path.join(cfg_dir, fname)

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

    runner.create_file(cfg, path, root=True)
def _add_to_sysconfig_net_scripts ( ifname , addr , netmask ) : cfg_dir = "/etc/sysconfig/network-scripts/" cfg = ( "NM_CONTROLLED=\"yes\"\n" "DEVICE=\"{0}\"\n" "BOOTPROTO=none\n" "ONBOOT=\"no\"\n" "IPADDR={1}\n" "NETMASK={2}\n" ) . format ( ifname , addr , netmask ) fname = "ifcfg-" + ifname path = os . path . join ( cfg_dir , fname ) if ( runner . dry ) : util . fill_print ( "Create a file named {} at {} and add the " "following to it:" . format ( fname , cfg_dir ) ) print ( cfg ) return runner . create_file ( cfg , path , root = True )