Exemplo n.º 1
0
    def format_raw(self, shares, indent=""):
        sharedata = {}
        storage_cache = cache_storage_data()

        for dbshare in shares:
            if dbshare.name not in sharedata:
                share_info = find_storage_data(dbshare, storage_cache)

                sharedata[dbshare.name] = {"disks": 0,
                                           "machines": 0,
                                           "server": share_info.server,
                                           "mount": share_info.mount}
            sharedata[dbshare.name]["disks"] += dbshare.disk_count
            sharedata[dbshare.name]["machines"] += dbshare.machine_count

        details = []

        for name in sorted(sharedata.keys()):
            rec = sharedata[name]

            details.append(indent + "NAS Disk Share: %s" % name)
            details.append(indent + "  Server: %s" % rec["server"])
            details.append(indent + "  Mountpoint: %s" % rec["mount"])
            details.append(indent + "  Disk Count: %d" % rec["disks"])
            details.append(indent + "  Machine Count: %d" % rec["machines"])
        return "\n".join(details)
Exemplo n.º 2
0
    def format_raw(self, shares, indent=""):
        sharedata = {}
        storage_cache = cache_storage_data()

        for dbshare in shares:
            if dbshare.name not in sharedata:
                share_info = find_storage_data(dbshare, storage_cache)

                sharedata[dbshare.name] = {
                    "disks": 0,
                    "machines": 0,
                    "server": share_info.server,
                    "mount": share_info.mount
                }
            sharedata[dbshare.name]["disks"] += dbshare.disk_count
            sharedata[dbshare.name]["machines"] += dbshare.machine_count

        details = []

        for name in sorted(sharedata.keys()):
            rec = sharedata[name]

            details.append(indent + "NAS Disk Share: %s" % name)
            details.append(indent + "  Server: %s" % rec["server"])
            details.append(indent + "  Mountpoint: %s" % rec["mount"])
            details.append(indent + "  Disk Count: %d" % rec["disks"])
            details.append(indent + "  Machine Count: %d" % rec["machines"])
        return "\n".join(details)
Exemplo n.º 3
0
 def populate_share_info(self, cache):
     self._share_info = find_storage_data(self, cache)
Exemplo n.º 4
0
 def server(self):
     if not self._share_info:
         self._share_info = find_storage_data(self)
     return self._share_info.server
Exemplo n.º 5
0
 def mount(self):
     if not self._share_info:
         self._share_info = find_storage_data(self)
     return self._share_info.mount
Exemplo n.º 6
0
 def populate_share_info(self, cache):
     self._share_info = find_storage_data(self, cache)
Exemplo n.º 7
0
 def server(self):
     if not self._share_info:
         self._share_info = find_storage_data(self)
     return self._share_info.server
Exemplo n.º 8
0
 def mount(self):
     if not self._share_info:
         self._share_info = find_storage_data(self)
     return self._share_info.mount