Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)
Returns file system safe name for device, used for folders.

        def rtr_folder_name(network, node):
    """Returns file system safe name for device, used for folders."""
    foldername = fqdn(network, node)

    #TODO: come up with shortest unique name, eg Adelaide, Aarnet becomes
    # adl.aar, as want descriptive, but also short name
    # Use asn not domain, as domain leads to long filenames
    for illegal_char in [" ", "/", "_", ",", ".", "&", "-", "(", ")"]:
        foldername = foldername.replace(illegal_char, "_")
    # Don't want double _
    while "__" in foldername:
        foldername = foldername.replace("__", "_")
    return foldername
        


src/a/n/ank_le-HEAD/AutoNetkit/compiler/netkitcompiler.py   ank_le(Download)
def router_dir(network, rtr):
    """Returns path for router rtr"""
    foldername = ank.rtr_folder_name(network, rtr)
    return os.path.join(netkit_dir(network, rtr), foldername)
 
            #TODO: see if rtr label is still needed, if so replace with
            # appropriate naming module function
            rtr_folder_name = ank.rtr_folder_name(self.network, node)
 
            # sshd options

src/a/n/ank_le-HEAD/AutoNetkit/compiler/junoscompiler.py   ank_le(Download)
def router_conf_file(network, router):
    """Returns filename for config file for router"""
    return "%s.conf" % ank.rtr_folder_name(network, router)
 
def router_conf_path(network, router):

src/a/n/ank_le-HEAD/AutoNetkit/deploy/netkit_deploy.py   ank_le(Download)
        for node in self.network.devices():
            routername = ank.fqdn(self.network, node)
            full_routername = ank.rtr_folder_name(self.network, node)
            user_exec_prompt = "%s>" % node.dns_hostname
            priv_exec_prompt = "%s#" % node.dns_hostname

src/a/n/ank_le-HEAD/AutoNetkit/compiler/libvirtcompiler.py   ank_le(Download)
    def router_conf_file(network, router):
        """Returns filename for config file for router"""
        return "%s.conf" % ank.rtr_folder_name(network, router)
 
    def router_conf_path(self, network, router):