Пример #1
0
    def summary(self):
        so = self.rtsnode
        errors = []
        if so.backstore.plugin.startswith("rd"):
            path = "ramdisk"
        else:
            path = so.udev_path

        if not path:
            errors.append("BROKEN STORAGE LINK")

        legacy = []
        if self.rtsnode.name != self.name:
            legacy.append("ADDED SUFFIX")
        if len(list(self.rtsnode.backstore.storage_objects)) > 1:
            legacy.append("SHARED HBA")

        if legacy:
            errors.append("LEGACY: " + ", ".join(legacy))

        size = convert_bytes_to_human(getattr(so, "size", 0))
        nullio_str = ""
        try:
            if so.nullio:
                nullio_str = " (nullio)"
        except AttributeError:
            pass

        if errors:
            msg = ", ".join(errors)
            if path:
                msg += " (%s %s)" % (path, so.status)
            return (msg, False)
        else:
            return ("%s %s%s%s" % (path, size, so.status, nullio_str), True)
Пример #2
0
    def summary(self):
        so = self.rtsnode
        errors = []
        if so.backstore.plugin.startswith("rd"):
            path = "ramdisk"
        else:
            path = so.udev_path

        if not path:
            errors.append("BROKEN STORAGE LINK")

        legacy = []
        if self.rtsnode.name != self.name:
            legacy.append("ADDED SUFFIX")
        if len(list(self.rtsnode.backstore.storage_objects)) > 1:
            legacy.append("SHARED HBA")

        if legacy:
            errors.append("LEGACY: " + ", ".join(legacy))

        size = convert_bytes_to_human(getattr(so, "size", 0))
        if so.status == "activated":
            status = "in use"
        else:
            status = "not in use"
        nullio_str = ""
        try:
            if so.nullio:
                nullio_str = "nullio"
        except AttributeError:
            pass

        if errors:
            info = ", ".join(errors)
            if path:
                info += " (%s %s)" % (path, status)
            return (info, False)
        else:
            info = ", ".join([
                "%s" % str(data) for data in (size, path, status, nullio_str)
                if data
            ])
            return (info, True)
Пример #3
0
    def summary(self):
        so = self.rtsnode
        errors = []
        if so.backstore.plugin.startswith("rd"):
            path = "ramdisk"
        else:
            path = so.udev_path

        if not path:
            errors.append("BROKEN STORAGE LINK")

        legacy = []
        if self.rtsnode.name != self.name:
            legacy.append("ADDED SUFFIX")
        if len(list(self.rtsnode.backstore.storage_objects)) > 1:
            legacy.append("SHARED HBA")

        if legacy:
            errors.append("LEGACY: " + ", ".join(legacy))

        size = convert_bytes_to_human(getattr(so, "size", 0))
        if so.status == "activated":
            status = "in use"
        else:
            status = "not in use"
        nullio_str = ""
        try:
            if so.nullio:
                nullio_str = "nullio"
        except AttributeError:
            pass

        if errors:
            info = ", ".join(errors)
            if path:
                info += " (%s %s)" % (path, status)
            return (info, False)
        else:
            info = ", ".join(["%s" % str(data)
                            for data in (size, path, status, nullio_str)
                            if data])
            return (info, True)
Пример #4
0
def _b2h(b):
    return convert_bytes_to_human(b)
Пример #5
0
def _b2h(b):
    # FIXME: Fix convert_bytes_to_human() instead of juggling here
    return convert_bytes_to_human(b)[1:-2]
Пример #6
0
def _b2h(b):
    # FIXME: Fix convert_bytes_to_human() instead of juggling here
    return convert_bytes_to_human(b)[1:-2]
Пример #7
0
def _b2h(b):
    return convert_bytes_to_human(b)