diff options
Diffstat (limited to 'lib/ManaTools/Shared/TimeZone.pm')
-rw-r--r-- | lib/ManaTools/Shared/TimeZone.pm | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/lib/ManaTools/Shared/TimeZone.pm b/lib/ManaTools/Shared/TimeZone.pm index 46810db0..155de20d 100644 --- a/lib/ManaTools/Shared/TimeZone.pm +++ b/lib/ManaTools/Shared/TimeZone.pm @@ -209,8 +209,9 @@ has 'ntpServiceConfig' => ( =head3 ntpServiceList - This attribute is a ArrayRef containing configured ntp - service into the system, retrieving info from services. + This attribute is a ArrayRef containing the sorted list of + configured NTP service into the system, retrieving info from + services. =cut @@ -232,7 +233,7 @@ sub _build_ntpServiceList { push @list, $pair->[0] if eval {$self->sh_services->dbus_systemd1_object->GetUnitFileState( $pair->[0] . ".service")}; } - return \@list; + return [ sort(@list) ]; } #============================================================= @@ -435,6 +436,27 @@ sub _buildNTPServers { #============================================================= +=head2 refreshNTPServiceList + +=head3 DESCRIPTION + + Refresh the ntpServiceList attribute value, usefull + if any NTP service has been istalled after having + instantiated this object + +=cut + +#============================================================= +sub refreshNTPServiceList { + my $self = shift; + + my $list = $self->_build_ntpServiceList(); + + $self->ntpServiceList($list); +} + +#============================================================= + =head2 get_timezone_prefix =head3 OUTPUT |