aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ManaTools/Shared/disk_backend/Plugin/Partition.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ManaTools/Shared/disk_backend/Plugin/Partition.pm')
-rw-r--r--lib/ManaTools/Shared/disk_backend/Plugin/Partition.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/ManaTools/Shared/disk_backend/Plugin/Partition.pm b/lib/ManaTools/Shared/disk_backend/Plugin/Partition.pm
index e9a67ab8..534beda0 100644
--- a/lib/ManaTools/Shared/disk_backend/Plugin/Partition.pm
+++ b/lib/ManaTools/Shared/disk_backend/Plugin/Partition.pm
@@ -245,6 +245,7 @@ use Moose;
extends 'ManaTools::Shared::disk_backend::Part';
with 'ManaTools::Shared::disk_backend::BlockDevice';
+with 'ManaTools::Shared::disk_backend::PurposeLabelRole';
use MooseX::ClassAttribute;
@@ -305,4 +306,13 @@ class_has '+restrictions' => (
}
);
+override('label', sub {
+ my $self = shift;
+ my $label = super;
+ return $label if $label ne $self->type();
+
+ # get the name from the devicepath
+ return $self->devicepath() =~ s'^.+/''r;
+});
+
1;