aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ManaTools/Shared
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2015-03-25 09:55:51 +0100
committerAngelo Naselli <anaselli@linux.it>2015-03-25 09:55:51 +0100
commit865bc40654354ccc6e2ffd97b7f6b361008c4e0b (patch)
tree3aafc71b430e9c2194d02797fff7fd28cfbe5956 /lib/ManaTools/Shared
parent6eaf389403cdbfbf25462f16b1c6e423778b2ba9 (diff)
downloadmanatools-865bc40654354ccc6e2ffd97b7f6b361008c4e0b.tar
manatools-865bc40654354ccc6e2ffd97b7f6b361008c4e0b.tar.gz
manatools-865bc40654354ccc6e2ffd97b7f6b361008c4e0b.tar.bz2
manatools-865bc40654354ccc6e2ffd97b7f6b361008c4e0b.tar.xz
manatools-865bc40654354ccc6e2ffd97b7f6b361008c4e0b.zip
Added ntpServiceConfig attribute
Diffstat (limited to 'lib/ManaTools/Shared')
-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);