aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/ManaTools/Shared/TimeZone.pm61
1 files changed, 58 insertions, 3 deletions
diff --git a/lib/ManaTools/Shared/TimeZone.pm b/lib/ManaTools/Shared/TimeZone.pm
index c1a1331b..3be11d77 100644
--- a/lib/ManaTools/Shared/TimeZone.pm
+++ b/lib/ManaTools/Shared/TimeZone.pm
@@ -172,6 +172,45 @@ sub _ntp_program_init {
#=============================================================
+=head2 attribute
+
+=head3 ntpServiceConfig
+
+ This RO attribute is a HashRef containing managed ntp
+ service as key and related configuration file.
+
+ Allowed actions:
+ getNTPServiceConfig => retrieves config file from the
+ given ntp service
+ ntpServiceConfigPairs => Key,Value pairs access
+
+=cut
+
+#=============================================================
+has 'ntpServiceConfig' => (
+ traits => ['Hash'],
+ default => sub { {
+ 'chronyd' => '/etc/chrony.conf',
+ 'ntpd' => '/etc/ntp.conf',
+ 'systemd-timesyncd' => '/etc/systemd/timesyncd.conf'
+ } },
+ is => 'ro',
+ isa => 'HashRef',
+ handles => {
+ getNTPServiceConfig => 'get',
+ ntpServiceConfigPairs => 'kv',
+ },
+ init_arg => undef,
+);
+
+# has 'dmlist' => (
+# is => 'rw',
+# isa => 'ArrayRef',
+# builder => '_build_dmlist',
+# );
+
+#=============================================================
+
=head2 new - optional parameters
=head3 installer_or_livecd
@@ -737,7 +776,6 @@ Returns the current ntp server address read from configuration file
=cut
#=============================================================
-
sub ntpCurrentServer {
my $self = shift;
@@ -746,6 +784,25 @@ sub ntpCurrentServer {
#=============================================================
+=head2 currentNTPService
+
+=head3 DESCRIPTION
+
+ Returns the current ntp service
+
+=cut
+
+#=============================================================
+sub currentNTPService {
+ my $self = shift;
+
+ my $ntpd = $self->ntp_program;
+
+ return $ntpd;
+}
+
+#=============================================================
+
=head2 isNTPRunning
=head3 DESCRIPTION
@@ -758,8 +815,6 @@ sub ntpCurrentServer {
sub isNTPRunning {
my $self = shift;
- $DB::single = 1;
-
my $ntpd = $self->ntp_program;
my $isRunning = $self->sh_services->is_service_running($ntpd);