[PATCH] Fix nfsiso repo selection (#871648)
by Jesse Keating
Two fixes here, one set the path to INSTALL_TREE because we haven't
moved anything over to ISO_DIR yet. Two account for the isys mount
count for paths. When we move a mount point the isys count must be
updated so that an attempt later to mount the iso into the INSTALL_TREE
won't be short circuited.
One could create an (_)isys call that does the move and does the
accounting, but that would add more C code, which is an anti-goal.
---
pyanaconda/packaging/yumpayload.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 6b423fc..787f951 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -558,7 +558,7 @@ reposdir=%s
self._setupNFS(INSTALL_TREE, method.server, method.dir, method.opts)
# check for ISO images in the newly mounted dir
- path = ISO_DIR
+ path = INSTALL_TREE
if method.dir.endswith(".iso"):
# if the given URL includes a specific ISO image file, use it
image_file = os.path.basename(method.dir)
@@ -577,6 +577,17 @@ reposdir=%s
iutil.execWithRedirect("mount",
["--move", INSTALL_TREE, ISO_DIR],
stderr="/dev/tty5", stdout="/dev/tty5")
+ # Mounts are kept track of in isys it seems
+ # Remove the count for the source
+ if isys.mountCount.has_key(INSTALL_TREE):
+ if isys.mountCount[INSTALL_TREE] > 1:
+ isys.mountCount[INSTALL_TREE] -= 1
+ else:
+ del(isys.mountCount[INSTALL_TREE])
+ # Add a count for the new location
+ if not isys.mountCount.has_key(ISO_DIR):
+ isys.mountCount[ISO_DIR] = 0
+ isys.mountCount[ISO_DIR] += 1
# mount the ISO on a loop
image = os.path.normpath("%s/%s" % (ISO_DIR, image))
mountImage(image, INSTALL_TREE)
--
1.7.11.4
11 years, 5 months
[PATCH] Do not return None from Size.__str__ (#869405)
by Vratislav Podzimek
If no value is < 1000, return the value in YBs.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/storage/size.py | 40 +++++++++++++++++++++-------------------
1 file changed, 21 insertions(+), 19 deletions(-)
diff --git a/pyanaconda/storage/size.py b/pyanaconda/storage/size.py
index 757c97b..25247fc 100644
--- a/pyanaconda/storage/size.py
+++ b/pyanaconda/storage/size.py
@@ -208,27 +208,29 @@ class Size(Decimal):
if Decimal(check) < 1000:
return "%s B" % check
- for factor, prefix, abbr in _prefixes:
+ for item in _prefixes:
+ factor, prefix, abbr = item
newcheck = super(Size, self).__div__(Decimal(factor))
if newcheck < 1000:
- if places is not None:
- fmt = "%%.%df" % places
- retval = fmt % newcheck
- else:
- retval = self._trimEnd("%f" % newcheck)
-
- if max_places is not None:
- (whole, point, fraction) = retval.partition(".")
- if point and len(fraction) > max_places:
- if max_places == 0:
- retval = whole
- else:
- retval = "%s.%s" % (whole, fraction[:max_places])
-
- if abbr:
- return retval + " " + abbr + _("B")
+ # nice value, use this factor, prefix and abbr
+ break
+
+ if places is not None:
+ fmt = "%%.%df" % places
+ retval = fmt % newcheck
+ else:
+ retval = self._trimEnd("%f" % newcheck)
+
+ if max_places is not None:
+ (whole, point, fraction) = retval.partition(".")
+ if point and len(fraction) > max_places:
+ if max_places == 0:
+ retval = whole
else:
- return retval + " " + prefix + P_("byte", "bytes", newcheck)
+ retval = "%s.%s" % (whole, fraction[:max_places])
- return None
+ if abbr:
+ return retval + " " + abbr + _("B")
+ else:
+ return retval + " " + prefix + P_("byte", "bytes", newcheck)
--
1.7.11.7
11 years, 5 months
[PATCH] On error, reset the RHS to what it used to be (#869422).
by Chris Lumens
We don't want to lock the user into a particular spoke. Resetting the RHS
clears out whatever changes were made that produced an error, but the user
can still continue if they want the previous settings.
---
pyanaconda/ui/gui/spokes/custom.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 404f844..a2e9e07 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -935,6 +935,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._error = mountpoint_validation_msgs[error]
self.window.set_info(Gtk.MessageType.WARNING, self._error)
self.window.show_all()
+ self._populate_right_side(selector)
return
raid_level = self._get_raid_level()
@@ -960,6 +961,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
if error:
self.window.set_info(Gtk.MessageType.WARNING, error)
self.window.show_all()
+ self._populate_right_side(selector)
return
with ui_storage_logger():
--
1.7.11.2
11 years, 5 months
[PATCH] Network spoke: fix hostname handling in standalone spoke (#868535)
by Radek Vykydal
Probably F18 Beta blocker.
---
pyanaconda/ui/gui/spokes/network.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index 56dca68..72badd3 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -1012,11 +1012,14 @@ class NetworkStandaloneSpoke(StandaloneSpoke):
self._now_available = False
def apply(self):
+ hostname = self.data.network.hostname
self.data.network.network = []
for dev in self.network_control_box.listed_devices:
network_data = getKSNetworkData(dev)
if network_data is not None:
self.data.network.network.append(network_data)
+ nd = kickstartNetworkData(hostname=hostname)
+ self.data.network.network.append(nd)
self._now_available = self.completed
--
1.7.4
11 years, 5 months
[PATCH] Network spoke: fix config info update after switching device OFF and ON (#871429)
by Radek Vykydal
---
pyanaconda/ui/gui/spokes/network.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index 366b87e..56dca68 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -370,6 +370,8 @@ class NetworkControlBox():
def on_device_state_changed(self, *args):
device = args[0]
new_state = args[1]
+ if new_state == NetworkManager.DeviceState.SECONDARIES:
+ return
self._refresh_carrier_info()
read_config_values = (new_state == NetworkManager.DeviceState.ACTIVATED)
if device == self.selected_device():
--
1.7.4
11 years, 5 months
[PATCH] Network spoke: connected requires activated (not active) connection (#871129)
by Radek Vykydal
This is for F18 Beta.
Next things to do:
- update status in HUB dynamically
- add connecting and disconnecting states
---
pyanaconda/ui/gui/spokes/network.py | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index 21a9eae..366b87e 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -347,11 +347,13 @@ class NetworkControlBox():
device = self.selected_device()
self.refresh_ui(device)
- def active_connections(self):
+ def activated_connections(self):
"""Returns list of tuples (device_name, ssid), ssid is None for wired."""
active_devs = []
for con in self.client.get_active_connections():
+ if con.get_state() != NetworkManager.ActiveConnectionState.ACTIVATED:
+ continue
device = con.get_devices()[0]
if device.get_device_type() == NetworkManager.DeviceType.ETHERNET:
active_devs.append((device.get_iface(), None))
@@ -946,14 +948,14 @@ class NetworkSpoke(NormalSpoke):
def completed(self):
# TODO: check also if source requires updates when implemented
return (self.data.method.method not in ("url", "nfs") or
- len(self.network_control_box.active_connections()) > 0)
+ len(self.network_control_box.activated_connections()) > 0)
@property
def status(self):
""" A short string describing which devices are connected. """
msg = _("Not connected")
- ac = self.network_control_box.active_connections()
+ ac = self.network_control_box.activated_connections()
if ac:
if len(ac) == 1:
device, ssid = ac[0]
@@ -1028,7 +1030,7 @@ class NetworkStandaloneSpoke(StandaloneSpoke):
@property
def completed(self):
- return len(self.network_control_box.active_connections()) > 0
+ return len(self.network_control_box.activated_connections()) > 0
def initialize(self):
StandaloneSpoke.initialize(self)
--
1.7.4
11 years, 5 months
[PATCH (nice to have)] Don't prompt when in cmdline mode (#869685)
by Jesse Keating
cmdline mode is text mode only, so that's why this patch only touches
the tui code.
---
pyanaconda/ui/tui/__init__.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/pyanaconda/ui/tui/__init__.py b/pyanaconda/ui/tui/__init__.py
index 9f34c4a..b20dc17 100644
--- a/pyanaconda/ui/tui/__init__.py
+++ b/pyanaconda/ui/tui/__init__.py
@@ -21,6 +21,7 @@
from pyanaconda import ui
from pyanaconda.ui import common
+from pyanaconda.flags import flags
import simpleline as tui
from hubs.summary import SummaryHub
from hubs.progress import ProgressHub
@@ -182,7 +183,12 @@ class TextUserInterface(ui.UserInterface):
In the code, this method should be used sparingly and only for those
times where anaconda cannot make a reasonable decision. We don't
want to overwhelm the user with choices.
+
+ When cmdline mode is active, the default will be to answer no.
"""
+ if flags.automatedInstall and not flags.ksprompt:
+ # If we're in cmdline mode, just say no.
+ return False
question_window = YesNoDialog(self._app, message)
self._app.switch_screen_modal(question_window)
return question_window.answer
--
1.7.11.4
11 years, 5 months
[PATCH (nice to have)] Force a root password to be set (#869675)
by Jesse Keating
---
pyanaconda/ui/gui/spokes/password.glade | 2 +-
pyanaconda/ui/gui/spokes/password.py | 16 +++++++---------
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/password.glade b/pyanaconda/ui/gui/spokes/password.glade
index 23b0c73..363ed36 100644
--- a/pyanaconda/ui/gui/spokes/password.glade
+++ b/pyanaconda/ui/gui/spokes/password.glade
@@ -116,7 +116,7 @@
<object class="GtkLabel" id="details">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">The root account is used for administering the system. Enter a password for the root user. Leave blank to disable (lock) the account.</property>
+ <property name="label" translatable="yes">The root account is used for administering the system. Enter a password for the root user.</property>
<property name="wrap">True</property>
</object>
<packing>
diff --git a/pyanaconda/ui/gui/spokes/password.py b/pyanaconda/ui/gui/spokes/password.py
index c67afb6..6ffb2f6 100644
--- a/pyanaconda/ui/gui/spokes/password.py
+++ b/pyanaconda/ui/gui/spokes/password.py
@@ -83,15 +83,9 @@ class PasswordSpoke(NormalSpoke):
return _("Root password is not set")
def apply(self):
- if self._password:
- self.data.rootpw.password = cryptPassword(self._password)
- self.data.rootpw.isCrypted = True
- self.data.rootpw.lock = False
- else:
- # Blank password case, disable the account
- self.data.rootpw.lock = True
- self.data.rootpw.password = ''
- self.data.rootpw.isCrypted = False
+ self.data.rootpw.password = cryptPassword(self._password)
+ self.data.rootpw.isCrypted = True
+ self.data.rootpw.lock = False
@property
def completed(self):
@@ -105,6 +99,10 @@ class PasswordSpoke(NormalSpoke):
pw = self.pw.get_text()
confirm = self.confirm.get_text()
+ if not pw and not confirm:
+ self._error = _("You must provide and confirm a password.")
+ return False
+
try:
self._error = validatePassword(pw, confirm)
except PWQError as (e, msg):
--
1.7.11.4
11 years, 5 months
[PATCH] Don't prompt when in cmdline mode (#869685)
by Jesse Keating
cmdline mode is text mode only, so that's why this patch only touches
the tui code.
---
pyanaconda/ui/tui/__init__.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/pyanaconda/ui/tui/__init__.py b/pyanaconda/ui/tui/__init__.py
index 9f34c4a..56791ba 100644
--- a/pyanaconda/ui/tui/__init__.py
+++ b/pyanaconda/ui/tui/__init__.py
@@ -21,6 +21,7 @@
from pyanaconda import ui
from pyanaconda.ui import common
+from pyanaconda.flags import flags
import simpleline as tui
from hubs.summary import SummaryHub
from hubs.progress import ProgressHub
@@ -183,6 +184,9 @@ class TextUserInterface(ui.UserInterface):
times where anaconda cannot make a reasonable decision. We don't
want to overwhelm the user with choices.
"""
+ if flags.automatedInstall and not flags.ksprompt:
+ # If we're in cmdline mode, just say no.
+ return False
question_window = YesNoDialog(self._app, message)
self._app.switch_screen_modal(question_window)
return question_window.answer
--
1.7.11.4
11 years, 5 months
[PATCH] Blank out passphrases from /root/anaconda-ks.cfg (#868519).
by Chris Lumens
Note that this means the resulting kickstart file will be less-than-complete,
which is not what we want but is apparently what users want. Any bugs filed
regarding this will be closed WONTFIX.
---
pyanaconda/install.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/pyanaconda/install.py b/pyanaconda/install.py
index 0bcfb40..b6fc3e8 100644
--- a/pyanaconda/install.py
+++ b/pyanaconda/install.py
@@ -37,6 +37,12 @@ def _writeKS(ksdata):
path = ROOT_PATH + "/root/anaconda-ks.cfg"
+ # Clear out certain sensitive information that kickstart doesn't have a
+ # way of representing encrypted.
+ for obj in [ksdata.autopart] + ksdata.logvol.dataList() + \
+ ksdata.partition.dataList() + ksdata.raid.dataList():
+ obj.passphrase = ""
+
with open(path, "w") as f:
f.write(str(ksdata))
--
1.7.11.2
11 years, 5 months