[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 1/2] Store NTP servers in self.data and set them up also on the installed system



---
 pyanaconda/kickstart.py                    |    5 +++++
 pyanaconda/ui/gui/spokes/datetime_spoke.py |   17 +++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 93c22c4..74a789d 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -46,6 +46,7 @@ import pykickstart.commands as commands
 from storage.devices import *
 from scdate.core import zonetab
 from pyanaconda import keyboard
+from pyanaconda import ntp
 
 from pykickstart.base import KickstartCommand
 from pykickstart.constants import *
@@ -1016,6 +1017,10 @@ class Timezone(commands.timezone.FC6_Timezone):
         self.anaconda.timezone.setTimezoneInfo(self.timezone, self.isUtc)
         self.anaconda.dispatch.skip_steps("timezone")
 
+        chronyd_conf_path = os.path.join(ROOT_PATH, ntp.NTP_CONFIG_FILE)
+        ntp.save_servers_to_config(self.ntp_servers,
+                                   conf_file_path=chronyd_conf_path)
+
 class VolGroupData(commands.volgroup.FC3_VolGroupData):
     def execute(self):
         pvs = []
diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py
index 6dfbfbd..6782185 100644
--- a/pyanaconda/ui/gui/spokes/datetime_spoke.py
+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py
@@ -71,6 +71,21 @@ class NTPconfigDialog(UIObject):
 
         return None
 
+    @property
+    def servers(self):
+        ret = list()
+
+        itr = self._serversStore.get_iter_first()
+        while itr:
+            row = self._serversStore[itr]
+            if row[2]:
+                #server checked
+                ret.append(row[0])
+
+            itr = self._serversStore.iter_next()
+
+        return ret
+
     def _render_working(self, column, renderer, model, itr, user_data=None):
         #get the value in the second column
         value = model[itr][1]
@@ -736,6 +751,8 @@ class DatetimeSpoke(NormalSpoke):
             response = self._config_dialog.run()
 
         if response == 1:
+            self.data.timezone.ntp_servers = self._config_dialog.servers
+
             if self._config_dialog.working_server is None:
                 self._show_no_ntp_server_warning()
             else:
-- 
1.7.4.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]