예제 #1
0
파일: netipv4.py 프로젝트: BergSoft/sexy
    def network_list(cls):
        networks = []

        base_dir = os.path.join(sexy.get_base_dir("db"), "net-ipv4")

        for entry in os.listdir(base_dir):
            # With or without the mask is the question...
            #network = cls(entry)
            #networks.append("%s/%s" % (entry, network.mask))
            networks.append("%s" % (entry))

        return networks
예제 #2
0
파일: netipv4.py 프로젝트: BergSoft/sexy
    def network_list(cls):
        networks = []

        base_dir = os.path.join(sexy.get_base_dir("db"), "net-ipv4")

        for entry in os.listdir(base_dir):
            # With or without the mask is the question...
            #network = cls(entry)
            #networks.append("%s/%s" % (entry, network.mask))
            networks.append("%s" % (entry))

        return networks
예제 #3
0
파일: host.py 프로젝트: BergSoft/sexy
    def hosts_list(cls, host_type=None):
        hosts = []

        if host_type:
            if host_type not in HOST_TYPES:
                raise Error("Host type must be one of %s" % (" ".join(HOST_TYPES)))

        base_dir = os.path.join(sexy.get_base_dir("db"), "host")

        if not os.path.isdir(base_dir):
            return []

        for entry in os.listdir(base_dir):
            if host_type:
                host = cls(entry)
                if host.host_type == host_type:
                    hosts.append(entry)
            else:
                hosts.append(entry)

        return hosts
예제 #4
0
파일: host.py 프로젝트: BergSoft/sexy
    def hosts_list(cls, host_type=None):
        hosts = []

        if host_type:
            if host_type not in HOST_TYPES:
                raise Error("Host type must be one of %s" %
                            (" ".join(HOST_TYPES)))

        base_dir = os.path.join(sexy.get_base_dir("db"), "host")

        if not os.path.isdir(base_dir):
            return []

        for entry in os.listdir(base_dir):
            if host_type:
                host = cls(entry)
                if host.host_type == host_type:
                    hosts.append(entry)
            else:
                hosts.append(entry)

        return hosts
예제 #5
0
파일: host.py 프로젝트: BergSoft/sexy
 def get_base_dir(fqdn):
     return os.path.join(sexy.get_base_dir("db"), "host", fqdn)
예제 #6
0
파일: netipv4.py 프로젝트: BergSoft/sexy
 def get_base_dir(network):
     return os.path.join(sexy.get_base_dir("db"), "net-ipv4", network)
예제 #7
0
파일: mac.py 프로젝트: BergSoft/sexy
 def get_base_dir():
     return sexy.get_base_dir("db/mac")
예제 #8
0
파일: host.py 프로젝트: BergSoft/sexy
 def get_base_dir(fqdn):
     return os.path.join(sexy.get_base_dir("db"), "host", fqdn)
예제 #9
0
파일: netipv4.py 프로젝트: BergSoft/sexy
 def get_base_dir(network):
     return os.path.join(sexy.get_base_dir("db"), "net-ipv4", network)
예제 #10
0
 def get_base_dir():
     return sexy.get_base_dir("db/mac")