[initial-setup] Initial Setup patches and one related anaconda patch
by Vratislav Podzimek
Two bug fixes for the Initial Setup. The PATCH 2/2 requires a proposed change
in the anaconda's codebase. Please note that that change would be also useful
for addons if they provide hubs or standalone spoke (though we discourage people
to do so, it may be needed at some point).
Vratislav Podzimek (2):
Disable the service only on successful exit (#967617)
Warn if no user has been created (#965797)
initial-setup | 2 +-
initial_setup/gui/hubs/initial_setup.py | 29 ++++++++++++++++++++++++++++-
systemd/initial-setup-graphical.service | 1 -
systemd/initial-setup-text.service | 1 -
4 files changed, 29 insertions(+), 4 deletions(-)
--
1.7.11.7
10 years, 11 months
[PATCH 1/4] Slap an r"" on some strings to help them be identified as a regex.
by Chris Lumens
---
pyanaconda/bootloader.py | 6 +++---
pyanaconda/network.py | 2 +-
pyanaconda/ui/gui/spokes/langsupport.py | 2 +-
pyanaconda/ui/gui/spokes/welcome.py | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index bb0775f..be89e15 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -99,7 +99,7 @@ def parse_serial_opt(arg):
Also note that the kernel assumes 1 stop bit; this can't be changed.
"""
opts = serial_opts()
- m = re.match('\d+', arg)
+ m = re.match(r'\d+', arg)
if m is None:
return opts
opts.speed = m.group()
@@ -2061,8 +2061,8 @@ class ZIPL(BootLoader):
# Preparing boot device: dasdb (0200).
# Preparing boot device: dasdl.
# We want to extract the device name and pass that.
- name = re.sub(".+?: ", "", line)
- self.stage1_name = re.sub("(\s\(.+\))?\.$", "", name)
+ name = re.sub(r".+?: ", "", line)
+ self.stage1_name = re.sub(r"(\s\(.+\))?\.$", "", name)
if not self.stage1_name:
raise BootLoaderError("could not find IPL device")
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 2e93f1c..e0952ae 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -56,7 +56,7 @@ DEFAULT_HOSTNAME = "localhost.localdomain"
# part of a valid hostname between two periods (cannot start nor end with '-')
# for more info about '(?!-)' and '(?<!-)' see 're' module documentation
-HOSTNAME_PART_RE = re.compile("(?!-)[A-Z\d-]{1,63}(?<!-)$", re.IGNORECASE)
+HOSTNAME_PART_RE = re.compile(r"(?!-)[A-Z\d-]{1,63}(?<!-)$", re.IGNORECASE)
ifcfglog = None
def setup_ifcfg_log():
diff --git a/pyanaconda/ui/gui/spokes/langsupport.py b/pyanaconda/ui/gui/spokes/langsupport.py
index 8e90cb7..b071c01 100644
--- a/pyanaconda/ui/gui/spokes/langsupport.py
+++ b/pyanaconda/ui/gui/spokes/langsupport.py
@@ -137,7 +137,7 @@ class LangsupportSpoke(NormalSpoke):
return retval
def _add_language(self, store, native, english, setting, selected, additional):
- store.append(['<span lang="%s">%s</span>' % (re.sub('\..*', '', setting), native),
+ store.append(['<span lang="%s">%s</span>' % (re.sub(r'\..*', '', setting), native),
english, setting, selected, additional])
def _select_language(self, store, language):
diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py
index 9a1f678..5c3a47f 100644
--- a/pyanaconda/ui/gui/spokes/welcome.py
+++ b/pyanaconda/ui/gui/spokes/welcome.py
@@ -259,7 +259,7 @@ class WelcomeLanguageSpoke(StandaloneSpoke):
self._languageStoreFilter.refilter()
def _addLanguage(self, store, native, english, setting):
- lang = '<span lang="%s">%s</span>' % (re.sub('\..*', '', setting), native)
+ lang = '<span lang="%s">%s</span>' % (re.sub(r'\..*', '', setting), native)
store.append([lang, english, setting, False])
def _matchesEntry(self, model, itr, *args):
--
1.8.1.2
10 years, 11 months
[PATCH] Convert escaped spaces on cmdline to _ (#874381)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
We use shlex.split to parse the cmdline. This mostly works, except that
it removes any \\ from the string instead of converting them back to \
This results in the device LABEL having x20 in it, which isn't matching
the ID_FS_LABEL when looking for protected devices.
So, this replaces the \\x20 with _ when parsing the cmdline, which also
matches what ID_FS_LABEL expects. This results in the usb device being
filtered from the available disks for the install.
---
pyanaconda/flags.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/pyanaconda/flags.py b/pyanaconda/flags.py
index 7a22c90..125db3a 100644
--- a/pyanaconda/flags.py
+++ b/pyanaconda/flags.py
@@ -143,6 +143,10 @@ class BootArgs(OrderedDict):
if right.count('"') % 2:
cmdline = left + middle + '"' + right
+ # shlex doesn't properly handle \\ (it removes them)
+ # which scrambles the spaces used in labels so use underscores
+ cmdline = cmdline.replace("\\x20", "_")
+
lst = shlex.split(cmdline)
for i in lst:
--
1.8.1.4
10 years, 11 months
[PATCH] write_config_console function for extlinux to write out serial console boot arguments bz#974643
by Dennis Gilmore
Signed-off-by: Dennis Gilmore <dennis(a)ausil.us>
---
pyanaconda/bootloader.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index e037482..bb0775f 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -2137,7 +2137,17 @@ class EXTLINUX(BootLoader):
return prefix
+ def write_config_console(self, config):
+ if not self.console:
+ return
+
+ console_arg = "console=%s" % self.console
+ if self.console_options:
+ console_arg += ",%s" % self.console_options
+ self.boot_args.add(console_arg)
+
def write_config_images(self, config):
+ self.write_config_console(config)
for image in self.images:
args = Arguments()
args.add("root=%s" % image.device.fstabSpec)
--
1.8.2.1
10 years, 11 months
[f19-branch][PATCH] Use nice names for environment in TUI software spoke (#971304)
by Samantha N. Bueno
---
pyanaconda/ui/tui/spokes/software.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/tui/spokes/software.py b/pyanaconda/ui/tui/spokes/software.py
index f8b3c87..63f5473 100644
--- a/pyanaconda/ui/tui/spokes/software.py
+++ b/pyanaconda/ui/tui/spokes/software.py
@@ -114,7 +114,9 @@ class SoftwareSpoke(NormalTUISpoke):
displayed = []
for env in environments:
- displayed.append(CheckboxWidget(title="%s" % env, completed=(environments.index(env) == self._selection)))
+ (name, desc) = self.payload.environmentDescription(env)
+
+ displayed.append(CheckboxWidget(title="%s" % name, completed=(environments.index(env) == self._selection)))
print(_("Choose a desktop environment."))
def _prep(i, w):
--
1.7.11.7
10 years, 11 months
[f19-branch][master][PATCH] Add option to install from CD/DVD in text UI. (#971191)
by Samantha N. Bueno
If optical media is detected, it is automatically set to be the
default install source. An option to manually select CD/DVD as the
install source is also present.
FYI this is an F19 blocker.
---
pyanaconda/ui/tui/spokes/source.py | 78 +++++++++++++++++++++++++++-----------
1 file changed, 56 insertions(+), 22 deletions(-)
diff --git a/pyanaconda/ui/tui/spokes/source.py b/pyanaconda/ui/tui/spokes/source.py
index 076a124..cd5f718 100644
--- a/pyanaconda/ui/tui/spokes/source.py
+++ b/pyanaconda/ui/tui/spokes/source.py
@@ -22,10 +22,11 @@
from pyanaconda.flags import flags
from pyanaconda.ui.tui.spokes import EditTUISpoke
from pyanaconda.ui.tui.spokes import EditTUISpokeEntry as Entry
-from pyanaconda.ui.tui.simpleline import CheckboxWidget, TextWidget
+from pyanaconda.ui.tui.simpleline import TextWidget, ColumnWidget
from pyanaconda.threads import threadMgr, AnacondaThread
from pyanaconda.packaging import PayloadError, MetadataError
from pyanaconda.i18n import _
+from pyanaconda.image import opticalInstallMedia
from pyanaconda.constants import THREAD_SOURCE_WATCHER, THREAD_SOFTWARE_WATCHER, THREAD_PAYLOAD
from pyanaconda.constants import THREAD_PAYLOAD_MD, THREAD_STORAGE, THREAD_CHECK_SOFTWARE
@@ -52,6 +53,7 @@ class SourceSpoke(EditTUISpoke):
EditTUISpoke.__init__(self, app, data, storage, payload, instclass)
self._ready = False
self.errors = []
+ self._cdrom = None
def initialize(self):
EditTUISpoke.initialize(self)
@@ -63,12 +65,23 @@ class SourceSpoke(EditTUISpoke):
""" Private initialize. """
threadMgr.wait(THREAD_STORAGE)
threadMgr.wait(THREAD_PAYLOAD)
+ # If we've previously set up to use a CD/DVD method, the media has
+ # already been mounted by payload.setup. We can't try to mount it
+ # again. So just use what we already know to create the selector.
+ # Otherwise, check to see if there's anything available.
+ if self.data.method.method == "cdrom":
+ self._cdrom = self.payload.install_device
+ elif not flags.automatedInstall:
+ self._cdrom = opticalInstallMedia(self.storage.devicetree)
+
self._ready = True
def _repo_status(self):
""" Return a string describing repo url or lack of one. """
if self.data.method.method == "url":
return self.data.method.url or self.data.method.mirrorlist
+ elif self.data.method.method == "cdrom":
+ return _("CD/DVD drive")
elif self.payload.baseRepo:
return _("Closest mirror")
else:
@@ -104,38 +117,59 @@ class SourceSpoke(EditTUISpoke):
threadMgr.wait(THREAD_PAYLOAD_MD)
- print(_("Choose an installation source type."))
+ _methods = [_("CD/DVD"), _("Network")]
+ if args == 2:
+ text = [TextWidget(p) for p in self._protocols]
+ else:
+ self._window += [TextWidget(_("Choose an installation source type."))]
+ text = [TextWidget(m) for m in _methods]
- msg = self._update_summary()
+ def _prep(i, w):
+ number = TextWidget("%2d)" % (i + 1))
+ return ColumnWidget([(4, [number]), (None, [w])], 1)
- for num, proto in enumerate(self._protocols):
- box = CheckboxWidget(title="%i) %s" % (num + 1, proto), completed=(num + 1 == self._selection))
- self._window += [box, ""]
+ # gnarl and mangle all of our widgets so things look pretty on screen
+ choices = [_prep(i, w) for i, w in enumerate(text)]
- self._window += [TextWidget(msg), ""]
+ displayed = ColumnWidget([(78, choices)], 1)
+ self._window.append(displayed)
return True
def input(self, args, key):
""" Handle the input; this decides the repo protocol. """
- if key == "c" and self._selection == 1:
- # closest mirror
- self.data.method.method = None
- self.apply()
-
- if key == "c" and self._selection in range(2, 5):
- self.data.method.method = "url"
-
- # want to kick off new spoke asking to specify repo
- newspoke = SpecifyRepoSpoke(self.app, self.data, self.storage,
- self.payload, self.instclass, self._selection)
- self.app.switch_screen_modal(newspoke)
- self.apply()
-
try:
num = int(key)
- if num in range(1, 5):
+ if args == 2:
+ # network install
+ ## FIXME: setting self._selection reeks a bit of redundancy
+ ## now that some of this has been rewritten, so it should be
+ ## done away with entirely in the future, at some point
self._selection = num
+ if self._selection == 1:
+ # closest mirror
+ self.data.method.method = None
+ self.apply()
+ self.close()
+ return True
+ elif self._selection in range(2, 5):
+ self.data.method.method = "url"
+ newspoke = SpecifyRepoSpoke(self.app, self.data, self.storage,
+ self.payload, self.instclass, self._selection)
+ self.app.switch_screen_modal(newspoke)
+ self.apply()
+ self.close()
+ return True
+ else:
+ if num == 1:
+ # iso selected, just set some vars and return to main hub
+ self.data.method.method = "cdrom"
+ self.payload.install_device = self._cdrom
+ self.apply()
+ self.close()
+ return True
+ else:
+ self.app.switch_screen(self, num)
return None
except (ValueError, IndexError):
return key
--
1.7.11.7
10 years, 11 months
[f19-branch/master] Yet another I-S set
by Vratislav Podzimek
Two more patches related to Initial Setup with no changes for the Anaconda.
Vratislav Podzimek (2):
Make the firstboot --reconfig option work
Continue from the hub if there are no spokes
pyanaconda/constants.py | 2 ++
pyanaconda/ui/common.py | 36 +++++++++++++++++++++++++++++++++---
pyanaconda/ui/gui/hubs/__init__.py | 9 +++++++--
pyanaconda/ui/gui/spokes/user.py | 20 ++++++++++++++++++++
pyanaconda/ui/tui/spokes/user.py | 19 +++++++++++++++++++
5 files changed, 81 insertions(+), 5 deletions(-)
--
1.7.11.7
10 years, 11 months
[f19-branch/master] Fix for crash on live installs
by Martin Kolman
This patch should fix the crash in live installs (bug 975159) reported by
Kamil Paral.
Martin Kolman (1):
Encode timezone from GeoIP as UTF-8 string (#975159)
pyanaconda/geoloc.py | 7 +++++++
1 file changed, 7 insertions(+)
--
1.8.1.4
10 years, 11 months
5S管理为什么总是一动就还原?-尚腾润
by 尚腾润
以后的两年,中国赴美留学人数大减,再加上他在北大学习成绩并不算优秀,赴美留学的梦想在努力了3年半后付诸东流,一起逝去的还有他所有的积蓄。为了谋生,俞敏洪去兼课教书,因触犯北大的利益而被记过处分。为了挽救颜面,他不得不离开北大。
如果说管理是一门艺术,而艺术最精华的就是创意。作为一名中基层领导者,面对新生代或者另类的
员工群体,在过往的管理过程中所做的一切到底是你或你的上司感兴趣,还是先让员工感兴趣呢?管理的
创意你有了吗?员工对你的管理感兴趣了吗?你打算做何努力?
详o情o见g附z件!
10 years, 11 months