Merge ~npochet/ntp-charm/+git/ntp-charm:allow-ntp-choice into ~pguimaraes/ntp-charm/+git/ntp-charm:master

Proposed by Nicolas Pochet
Status: Merged
Merged at revision: da732413353fd2454819caae1304e772cd991562
Proposed branch: ~npochet/ntp-charm/+git/ntp-charm:allow-ntp-choice
Merge into: ~pguimaraes/ntp-charm/+git/ntp-charm:master
Diff against target: 82 lines (+24/-2) (has conflicts)
2 files modified
config.yaml (+12/-0)
lib/ntp_implementation.py (+12/-2)
Conflict in config.yaml
Conflict in lib/ntp_implementation.py
Reviewer Review Type Date Requested Status
Pedro Guimarães Approve
Review via email: mp+365572@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Pedro Guimarães (pguimaraes) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/config.yaml b/config.yaml
2index 7f86798..3df2756 100644
3--- a/config.yaml
4+++ b/config.yaml
5@@ -44,6 +44,8 @@ options:
6 default: false
7 type: boolean
8 description: >
9+ DEPRECATED - please DO NOT use if you have more than approximately
10+ 20 units in this service.
11 Automatically select the most appropriate units in the service to
12 be a service stratum connecting with upstream NTP servers, and use
13 those units as time sources for the remaining units.
14@@ -51,6 +53,8 @@ options:
15 default: 6
16 type: int
17 description: >
18+ DEPRECATED - please DO NOT use if you have more than approximately
19+ 20 units in this service.
20 How many units should attempt to connect with upstream NTP servers?
21 use_iburst:
22 default: true
23@@ -62,6 +66,14 @@ options:
24 default: ""
25 type: string
26 description: >
27+<<<<<<< config.yaml
28 Setting as "ntp" will manually install NTPd package or "chrony" will
29 install Chronyd package; disregard of the available OS version. If
30 empty, it will take the version available for the OS
31+=======
32+ If set to "ntp" the ntp package will be installed and configured, or if set to
33+ "chrony" the chrony package will be installed and configured. If unspecified
34+ the appropriate package will be selected based on the operating system.
35+ Please note that the use of ntp on Ubuntu bionic or later is not recommended as it
36+ does not receive security updates.
37+>>>>>>> config.yaml
38diff --git a/lib/ntp_implementation.py b/lib/ntp_implementation.py
39index 0ce4ac6..55abc3c 100644
40--- a/lib/ntp_implementation.py
41+++ b/lib/ntp_implementation.py
42@@ -10,6 +10,7 @@ from charmhelpers.core.hookenv import (
43 )
44 import charmhelpers.contrib.templating.jinja as templating
45 import charmhelpers.core.host
46+import charmhelpers.core.hookenv
47 import charmhelpers.osplatform
48 import os.path
49 import shutil
50@@ -57,11 +58,13 @@ class NTPImplementation:
51
52 def set_config(self, config):
53 with open(self.config_file(), "w") as conffile:
54- conffile.write(templating.render(self._config_file_template(), config))
55+ conffile.write(templating.render(
56+ self._config_file_template(), config))
57
58 def set_startup_options(self, config):
59 with open(self._startup_config_file(), "w") as startup:
60- startup.write(templating.render(self._startup_template_file(), config))
61+ startup.write(templating.render(
62+ self._startup_template_file(), config))
63
64 def _startup_config_file(self):
65 raise NotImplementedError
66@@ -140,9 +143,16 @@ def get_implementation(implementation_name=None):
67 platform = charmhelpers.osplatform.get_platform()
68 version = float(charmhelpers.core.host.lsb_release()['DISTRIB_RELEASE'])
69
70+<<<<<<< lib/ntp_implementation.py
71 if config_get('ntp_package') == "ntp":
72 return NTPd()
73 elif config_get('ntp_package') == "chrony":
74+=======
75+ ntp_package = charmhelpers.core.hookenv.config('ntp_package')
76+ if ntp_package == "ntp":
77+ return NTPd()
78+ elif ntp_package == "chrony":
79+>>>>>>> lib/ntp_implementation.py
80 return Chronyd()
81
82 if platform == 'ubuntu':

Subscribers

People subscribed via source and target branches