From 708eb6dcf2e4e7602250a35ba7552ddad8a72419 Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Wed, 25 Mar 2015 17:08:20 +0100 Subject: added include_static_services property and its test --- lib/ManaTools/Shared/Services.pm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'lib/ManaTools/Shared/Services.pm') diff --git a/lib/ManaTools/Shared/Services.pm b/lib/ManaTools/Shared/Services.pm index abef8c31..c0f06c55 100644 --- a/lib/ManaTools/Shared/Services.pm +++ b/lib/ManaTools/Shared/Services.pm @@ -114,7 +114,25 @@ sub _dbusObjectInitialize { $self->dbus_systemd1_object($self->dbus_systemd1_service->get_object("/org/freedesktop/systemd1")); } +has 'include_static_services' => ( + is => 'rw', + isa => 'Bool', + default => 0 +); + +#============================================================= + +=head2 attributes +=head3 service_info + + A HashRef collecting all the service information. + if include_static_services (default is false) is set also static + services are included. + +=cut + +#============================================================= has 'service_info' => ( is => 'rw', traits => ['Hash'], @@ -149,7 +167,7 @@ sub _serviceInfoInitialization { $st = 'enabled'; } } - if ($st && $st ne 'static') { + if ($st && ($self->include_static_services() || $st ne 'static')) { $services{$name} = { 'name' => $s->[0], 'description' => $s->[1], -- cgit v1.2.1