代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/anaconda 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 4635e846a98182901777ab6de492020082f313cb Mon Sep 17 00:00:00 2001
From: Vendula Poncova <vponcova@redhat.com>
Date: Fri, 3 Jul 2020 12:12:33 +0200
Subject: [PATCH] Use the structure for time sources in network.py
Modify network.py to work with TimeSourceData instead of strings.
---
pyanaconda/network.py | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index f8e9b19a15..bce57354b1 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -16,14 +16,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-import gi
-gi.require_version("NM", "1.0")
-
-from gi.repository import NM
-
import shutil
-from pyanaconda.core import util, constants
import socket
import itertools
import os
@@ -34,17 +27,24 @@
from dasbus.typing import get_native
+from pyanaconda.anaconda_loggers import get_module_logger
+from pyanaconda.core import util, constants
from pyanaconda.core.i18n import _
from pyanaconda.core.kernel import kernel_arguments
from pyanaconda.core.regexes import HOSTNAME_PATTERN_WITHOUT_ANCHORS, \
IPV6_ADDRESS_IN_DRACUT_IP_OPTION
from pyanaconda.core.configuration.anaconda import conf
+from pyanaconda.core.constants import TIME_SOURCE_SERVER
from pyanaconda.modules.common.constants.services import NETWORK, TIMEZONE, STORAGE
from pyanaconda.modules.common.constants.objects import FCOE
from pyanaconda.modules.common.task import sync_run_task
from pyanaconda.modules.common.structures.network import NetworkDeviceInfo
+from pyanaconda.modules.common.structures.timezone import TimeSourceData
+
+import gi
+gi.require_version("NM", "1.0")
+from gi.repository import NM
-from pyanaconda.anaconda_loggers import get_module_logger
log = get_module_logger(__name__)
DEFAULT_HOSTNAME = "localhost.localdomain"
@@ -347,9 +347,20 @@ def _set_ntp_servers_from_dhcp():
hostnames.append(hostname)
# check if some NTP servers were specified from kickstart
- if not timezone_proxy.NTPServers and conf.target.is_hardware:
+ if not timezone_proxy.TimeSources and conf.target.is_hardware:
# no NTP servers were specified, add those from DHCP
- timezone_proxy.SetNTPServers(hostnames)
+ servers = []
+
+ for hostname in hostnames:
+ server = TimeSourceData()
+ server.type = TIME_SOURCE_SERVER
+ server.hostname = hostname
+ server.options = ["iburst"]
+ servers.append(server)
+
+ timezone_proxy.SetTimeSources(
+ TimeSourceData.to_structure_list(servers)
+ )
def wait_for_connected_NM(timeout=constants.NETWORK_CONNECTION_TIMEOUT, only_connecting=False):
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。