kdump-anaconda-addon/call-getMemoryBounds-to-the-match-method.patch

48 lines
1.7 KiB
Diff
Raw Normal View History

2021-08-07 10:31:04 +08:00
From 60fa4c1d1b15150c65b2f31c3447228cbd79fb01 Mon Sep 17 00:00:00 2001
From: Dave Young <dyoung@redhat.com>
Date: Thu, 30 Jul 2015 15:00:55 +0800
Subject: [PATCH] tui: call getMemoryBounds() call to the match() method
Jan Stancek reported Installation sporadically hangs because kdump addon's
tui spoke in: /usr/share/anaconda/addons/com_redhat_kdump/tui/spokes/kdump.py
is calling their getMemoryBounds() function which ends up calling anaconda's
isys.total_memory method resulting in various actions happening at import
time including trying log and getting stuck.
vpodzime suggest to move getMemoryBounds() call to the match() method
---
com_redhat_kdump/tui/spokes/kdump.py | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/com_redhat_kdump/tui/spokes/kdump.py b/com_redhat_kdump/tui/spokes/kdump.py
index 7a74011..d1b825c 100644
--- a/com_redhat_kdump/tui/spokes/kdump.py
+++ b/com_redhat_kdump/tui/spokes/kdump.py
@@ -35,13 +35,12 @@
__all__ = ["KdumpSpoke"]
class _re:
- def __init__(self, patten, low, up):
+ def __init__(self, patten):
self.re = re.compile(patten)
- self.low = low
- self.up = up
def match(self, key):
if self.re.match(key):
+ self.low, self.up, self.step = getMemoryBounds()
if key[-1] == 'M':
key = key[:-1]
key = int(key)
@@ -49,9 +48,8 @@ def match(self, key):
return True
return False
-lower, upper ,step = getMemoryBounds()
# Allow a string of digits optionally followed by 'M'
-RESERVE_VALID = _re(r'^(\d+M?)$', lower, upper)
+RESERVE_VALID = _re(r'^(\d+M?)$')
class KdumpSpoke(EditTUISpoke):
title = N_("Kdump")