(self)
return labels
Creates a mapping of device nodes to filesystem labels
Creates a mapping of device nodes to filesystem labels
Creates a mapping of device nodes to filesystem labels
def get_disk_labels(self):
        """
        Creates a mapping of device nodes to filesystem labels
        """
        path = '/dev/disk/by-label/'
        labels = {}
        if not os.path.isdir(path):
            return labels

        for label in os.listdir(path):
            label = label.replace('\\x2f', '/')
            device = os.path.realpath(path + '/' + label)
            labels[device] = label

        return labels
def get_disk_labels ( self ) : path = '/dev/disk/by-label/' labels = { } if not os . path . isdir ( path ) : return labels for label in os . listdir ( path ) : label = label . replace ( '\\x2f' , '/' ) device = os . path . realpath ( path + '/' + label ) labels [ device ] = label return labels