1 Star 0 Fork 23

Zhao Hang/anaconda

forked from src-anolis-os/anaconda 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0004-install-remove-CDN.patch 13.34 KB
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2022-05-13 16:15 . install: remove subscription and CDN
From 4122df61838e504a86b5ac6b4ea704d30f316c19 Mon Sep 17 00:00:00 2001
From: Liwei Ge <geliwei@openanolis.org>
Date: Fri, 13 May 2022 15:23:08 +0800
Subject: [PATCH 4/7] install: remove CDN
---
anaconda.py | 19 ---------------
data/anaconda-gtk.css | 22 -----------------
.../modules/common/constants/namespaces.py | 5 ----
.../modules/common/constants/services.py | 5 ----
.../modules/common/errors/installation.py | 12 ----------
pyanaconda/payload/manager.py | 5 +---
.../ui/gui/spokes/installation_source.glade | 12 +++++-----
.../ui/gui/spokes/installation_source.py | 24 +++----------------
.../ui/gui/spokes/software_selection.py | 2 --
9 files changed, 10 insertions(+), 96 deletions(-)
diff --git a/anaconda.py b/anaconda.py
index 1018bf2..0b37626 100755
--- a/anaconda.py
+++ b/anaconda.py
@@ -620,28 +620,6 @@ if __name__ == "__main__":
from pyanaconda import exception
anaconda.mehConfig = exception.initExceptionHandling(anaconda)
- # Start the subscription handling thread if the Subscription DBus module
- # provides enough authentication data.
- # - as kickstart only supports org + key authentication & nothing
- # else currently talks to the Subscription DBus module,
- # we only check if organization id & at least one activation
- # key are available
- from pyanaconda.modules.common.util import is_module_available
- from pyanaconda.modules.common.constants.services import SUBSCRIPTION
-
- if is_module_available(SUBSCRIPTION):
- from pyanaconda.ui.lib.subscription import org_keys_sufficient, \
- register_and_subscribe, kickstart_error_handler
- if org_keys_sufficient():
- threadMgr.add(
- AnacondaThread(
- name=constants.THREAD_SUBSCRIPTION,
- target=register_and_subscribe,
- args=[anaconda.payload],
- kwargs={"error_callback": kickstart_error_handler}
- )
- )
-
# add additional repositories from the cmdline to kickstart data
anaconda.add_additional_repositories_to_ksdata()
diff --git a/data/anaconda-gtk.css b/data/anaconda-gtk.css
index 60a670e..672556a 100644
--- a/data/anaconda-gtk.css
+++ b/data/anaconda-gtk.css
@@ -159,25 +159,3 @@ where the look is constant. This reduces redraws significantly and saves the CPU
for measurements. */
spinner { animation-timing-function: steps(24); }
-/* Set colors for the subscriptions listbox:
- * - disable background color, so that the
- * list box looks good even if half empty
- * - disable border color as well
- * - only rows should have a distinct background
- */
-.subscriptions_listbox {
- background-color: transparent;
- background-image: none;
- border-color: transparent;
- border-image: none;
-}
-
-#subscriptions_listbox_row {
- background-color: white;
- border-color: gray;
-}
-
-#subscriptions_listbox_row_spacer {
- background-color: transparent;
- border-color: transparent;
-}
diff --git a/pyanaconda/modules/common/constants/namespaces.py b/pyanaconda/modules/common/constants/namespaces.py
index 1556296..584da05 100644
--- a/pyanaconda/modules/common/constants/namespaces.py
+++ b/pyanaconda/modules/common/constants/namespaces.py
@@ -81,11 +81,6 @@ SERVICES_NAMESPACE = (
"Services"
)
-SUBSCRIPTION_NAMESPACE = (
- *MODULES_NAMESPACE,
- "Subscription"
-)
-
PAYLOADS_NAMESPACE = (
*MODULES_NAMESPACE,
"Payloads"
diff --git a/pyanaconda/modules/common/constants/services.py b/pyanaconda/modules/common/constants/services.py
index 6febe5f..7259b28 100644
--- a/pyanaconda/modules/common/constants/services.py
+++ b/pyanaconda/modules/common/constants/services.py
@@ -69,11 +69,6 @@ SERVICES = DBusServiceIdentifier(
message_bus=DBus
)
-SUBSCRIPTION = DBusServiceIdentifier(
- namespace=SUBSCRIPTION_NAMESPACE,
- message_bus=DBus
-)
-
# System services.
HOSTNAME = DBusServiceIdentifier(
diff --git a/pyanaconda/modules/common/errors/installation.py b/pyanaconda/modules/common/errors/installation.py
index 6f3200b..3cd8338 100644
--- a/pyanaconda/modules/common/errors/installation.py
+++ b/pyanaconda/modules/common/errors/installation.py
@@ -74,15 +74,3 @@ class StorageInstallationError(InstallationError):
"""Exception for the storage installation errors."""
pass
-
-@dbus_error("InsightsClientMissingError", namespace=ANACONDA_NAMESPACE)
-class InsightsClientMissingError(InstallationError):
- """Exception for missing Red Hat Insights utility."""
- pass
-
-
-@dbus_error("InsightsConnectError", namespace=ANACONDA_NAMESPACE)
-class InsightsConnectError(InstallationError):
- """Exception for error when connecting to Red Hat Insights."""
- pass
-
diff --git a/pyanaconda/payload/manager.py b/pyanaconda/payload/manager.py
index e8a3d20..63b4db4 100644
--- a/pyanaconda/payload/manager.py
+++ b/pyanaconda/payload/manager.py
@@ -22,7 +22,7 @@ from enum import IntEnum
from dasbus.error import DBusError
from pyanaconda.core.constants import THREAD_STORAGE, THREAD_PAYLOAD, THREAD_PAYLOAD_RESTART, \
- THREAD_WAIT_FOR_CONNECTING_NM, THREAD_SUBSCRIPTION, PAYLOAD_TYPE_DNF, \
+ THREAD_WAIT_FOR_CONNECTING_NM, PAYLOAD_TYPE_DNF, \
THREAD_STORAGE_WATCHER, THREAD_EXECUTE_STORAGE
from pyanaconda.core.i18n import _, N_
from pyanaconda.threading import threadMgr, AnacondaThread
@@ -186,9 +186,6 @@ class PayloadManager(object):
# (set and use payload.needs_network ?)
threadMgr.wait(THREAD_WAIT_FOR_CONNECTING_NM)
- # Wait for subscription
- threadMgr.wait(THREAD_SUBSCRIPTION)
-
payload.setup()
# If this is a non-package Payload, we're done
diff --git a/pyanaconda/ui/gui/spokes/installation_source.glade b/pyanaconda/ui/gui/spokes/installation_source.glade
index cd97865..482c0ee 100644
--- a/pyanaconda/ui/gui/spokes/installation_source.glade
+++ b/pyanaconda/ui/gui/spokes/installation_source.glade
@@ -726,7 +726,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">6</property>
+ <property name="position">5</property>
</packing>
</child>
<child>
@@ -745,7 +745,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">7</property>
+ <property name="position">6</property>
</packing>
</child>
<child>
@@ -891,7 +891,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">8</property>
+ <property name="position">7</property>
</packing>
</child>
<child>
@@ -956,7 +956,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">9</property>
+ <property name="position">8</property>
</packing>
</child>
<child>
@@ -973,7 +973,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">10</property>
+ <property name="position">9</property>
</packing>
</child>
<child>
@@ -1312,7 +1312,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">11</property>
+ <property name="position">10</property>
</packing>
</child>
</object>
diff --git a/pyanaconda/ui/gui/spokes/installation_source.py b/pyanaconda/ui/gui/spokes/installation_source.py
index e64bb63..6e88991 100644
--- a/pyanaconda/ui/gui/spokes/installation_source.py
+++ b/pyanaconda/ui/gui/spokes/installation_source.py
@@ -435,7 +435,6 @@ class SourceSpoke(NormalSpoke, GUISpokeInputCheckHandler, SourceSwitchHandler):
source_changed = self._update_payload_source()
repo_changed = self._update_payload_repos()
source_proxy = self.payload.get_source_proxy()
- cdn_source = source_proxy.Type == SOURCE_TYPE_CDN
if source_changed or repo_changed or self._error:
payloadMgr.restart_thread(self.payload, checkmount=False)
else:
@@ -451,12 +450,7 @@ class SourceSpoke(NormalSpoke, GUISpokeInputCheckHandler, SourceSwitchHandler):
"""
source_proxy = self.payload.get_source_proxy()
source_type = source_proxy.Type
-
- if self._cdn_button.get_active():
- if source_type == SOURCE_TYPE_CDN:
- return False
- switch_source(self.payload, SOURCE_TYPE_CDN)
- elif self._autodetect_button.get_active():
+ if self._autodetect_button.get_active():
if not self._cdrom:
return False
@@ -634,11 +628,7 @@ class SourceSpoke(NormalSpoke, GUISpokeInputCheckHandler, SourceSwitchHandler):
@property
def status(self):
source_proxy = self.payload.get_source_proxy()
- cdn_source = source_proxy.Type == SOURCE_TYPE_CDN
- if cdn_source:
- source_proxy = self.payload.get_source_proxy()
- return source_proxy.Description
- elif threadMgr.get(constants.THREAD_CHECK_SOFTWARE):
+ if threadMgr.get(constants.THREAD_CHECK_SOFTWARE):
return _("Checking software dependencies...")
elif not self.ready:
return _(BASEREPO_SETUP_MESSAGE)
@@ -668,7 +658,6 @@ class SourceSpoke(NormalSpoke, GUISpokeInputCheckHandler, SourceSwitchHandler):
self._autodetect_box = self.builder.get_object("autodetectBox")
self._autodetect_device_label = self.builder.get_object("autodetectDeviceLabel")
self._autodetect_label = self.builder.get_object("autodetectLabel")
- self._cdn_button = self.builder.get_object("cdnRadioButton")
self._hmc_button = self.builder.get_object("hmcRadioButton")
self._iso_button = self.builder.get_object("isoRadioButton")
self._iso_box = self.builder.get_object("isoBox")
@@ -740,7 +729,6 @@ class SourceSpoke(NormalSpoke, GUISpokeInputCheckHandler, SourceSwitchHandler):
# want to let me pass in user data.
# See also: https://bugzilla.gnome.org/show_bug.cgi?id=727919
self._autodetect_button.connect("toggled", self.on_source_toggled, self._autodetect_box)
- self._cdn_button.connect("toggled", self.on_source_toggled, None)
self._hmc_button.connect("toggled", self.on_source_toggled, None)
self._iso_button.connect("toggled", self.on_source_toggled, self._iso_box)
self._network_button.connect("toggled", self.on_source_toggled, self._network_box)
@@ -825,10 +813,6 @@ class SourceSpoke(NormalSpoke, GUISpokeInputCheckHandler, SourceSwitchHandler):
def _initialize(self):
threadMgr.wait(constants.THREAD_PAYLOAD)
- # If there is the Subscriptiopn DBus module, make the CDN radio button visible
- if is_module_available(SUBSCRIPTION):
- gtk_call_once(self._cdn_button.set_no_show_all, False)
-
# Get the current source.
source_proxy = self.payload.get_source_proxy()
source_type = source_proxy.Type
@@ -943,9 +927,7 @@ class SourceSpoke(NormalSpoke, GUISpokeInputCheckHandler, SourceSwitchHandler):
self._protocol_combo_box.set_active_id(PROTOCOL_MIRROR)
self._url_type_combo_box.set_active_id(URL_TYPE_BASEURL)
- if source_type == SOURCE_TYPE_CDN:
- self._cdn_button.set_active(True)
- elif source_type == SOURCE_TYPE_URL:
+ if source_type == SOURCE_TYPE_URL:
self._network_button.set_active(True)
# Get the current configuration.
diff --git a/pyanaconda/ui/gui/spokes/software_selection.py b/pyanaconda/ui/gui/spokes/software_selection.py
index 6f40535..66c0cda 100644
--- a/pyanaconda/ui/gui/spokes/software_selection.py
+++ b/pyanaconda/ui/gui/spokes/software_selection.py
@@ -298,8 +298,6 @@ class SoftwareSelectionSpoke(NormalSpoke):
if self._error_msgs:
return _("Error checking software selection")
- cdn_source = check_cdn_is_installation_source(self.payload)
-
if not self.ready:
return _("Installation source not set up")
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhaohang_mskdxl/anaconda.git
git@gitee.com:zhaohang_mskdxl/anaconda.git
zhaohang_mskdxl
anaconda
anaconda
a8

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385