[PATCH] Mark language search string translatable. (#955229)
by Samantha N. Bueno
---
pyanaconda/ui/gui/spokes/welcome.glade | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/welcome.glade b/pyanaconda/ui/gui/spokes/welcome.glade
index f0a4602..4f79b7c 100644
--- a/pyanaconda/ui/gui/spokes/welcome.glade
+++ b/pyanaconda/ui/gui/spokes/welcome.glade
@@ -367,7 +367,7 @@
<property name="invisible_char">●</property>
<property name="invisible_char_set">True</property>
<property name="secondary_icon_name">edit-clear-symbolic</property>
- <property name="placeholder_text">Type here to search.</property>
+ <property name="placeholder_text" translatable="yes">Type here to search.</property>
<signal name="changed" handler="on_entry_changed" swapped="no"/>
<signal name="icon-release" handler="on_clear_icon_clicked" swapped="no"/>
</object>
--
1.7.11.7
10 years, 2 months
[anaconda][PATCH] Allow hubs and standalone spokes decide if it is possible to continue
by Vratislav Podzimek
Related: rhbz#965797
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/ui/gui/hubs/__init__.py | 29 +++++++++++++++++++++++++++--
pyanaconda/ui/gui/spokes/__init__.py | 18 ++++++++++++++++--
2 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py
index 37daf47..bb473b6 100644
--- a/pyanaconda/ui/gui/hubs/__init__.py
+++ b/pyanaconda/ui/gui/hubs/__init__.py
@@ -354,11 +354,36 @@ class Hub(GUIObject, common.Hub):
self._update_spoke_id = GLib.timeout_add_seconds(1, self._update_spokes)
- ### SIGNAL HANDLERS
+ @property
+ def continue_possible(self):
+ """
+ Indicates whether it is possible to continue to the next action (hub,
+ standalone spoke,...). When overridden, IT IS THE HUB'S RESPONSIBILITY
+ to inform user, where the problem is and how to fix it.
+
+ """
+
+ return True
+
+ ### SIGNAL HANDLING
+ def _checked_continue(self, cb):
+ """
+ Checks if continue is possible (from the hub's perspective and if yes,
+ runs the callback.
+
+ """
+
+ if self.continue_possible:
+ cb()
+
+ def _register_continue_event_cb(self, cb):
+ """Registers the callback for the continue event adding the check."""
+
+ self.continueButton.connect("clicked", lambda *args: self._checked_continue(cb))
def register_event_cb(self, event, cb):
if event == "continue" and hasattr(self, "continueButton"):
- self.continueButton.connect("clicked", lambda *args: cb())
+ self._register_continue_event_cb(cb)
elif event == "quit" and hasattr(self, "quitButton"):
self.quitButton.connect("clicked", lambda *args: cb())
diff --git a/pyanaconda/ui/gui/spokes/__init__.py b/pyanaconda/ui/gui/spokes/__init__.py
index c1a35b3..bb85e1e 100644
--- a/pyanaconda/ui/gui/spokes/__init__.py
+++ b/pyanaconda/ui/gui/spokes/__init__.py
@@ -63,9 +63,23 @@ class StandaloneSpoke(Spoke, common.StandaloneSpoke):
Spoke.__init__(self, data)
common.StandaloneSpoke.__init__(self, data, storage, payload, instclass)
+ @property
+ def continue_possible(self):
+ """
+ Indicates whether it is possible to continue to the next action (hub,
+ standalone spoke,...). When overridden, IT IS THE SPOKES'S
+ RESPONSIBILITY to inform user, where the problem is and how to fix it.
+
+ """
+
+ return True
+
+
+ ### SIGNAL HANDLING
def _on_continue_clicked(self, cb):
- self.apply()
- cb()
+ if self.continue_possible:
+ self.apply()
+ cb()
def register_event_cb(self, event, cb):
if event == "continue":
--
1.7.11.7
10 years, 3 months
FBA EDEV/EAV support
by Samantha N. Bueno
These patches should get pulled into F19 branch. IBM has already tested
these fixes and verified correct/expected behavior.
10 years, 8 months
[rhel6-branch] Pass mountopts to swap options (#857517)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
swap is based on DeviceFormat, not FS, so mountopts weren't being
handled. It has its own options property though, so just pass on the
mountopts to options.
Resolves: rhbz#857517
---
storage/formats/swap.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/storage/formats/swap.py b/storage/formats/swap.py
index 824c501..de5c30a 100644
--- a/storage/formats/swap.py
+++ b/storage/formats/swap.py
@@ -64,6 +64,8 @@ class SwapSpace(DeviceFormat):
self.priority = kwargs.get("priority")
self.label = kwargs.get("label")
+ if "mountopts" in kwargs:
+ self.options = kwargs.get("mountopts")
def __str__(self):
s = DeviceFormat.__str__(self)
--
1.8.1.4
10 years, 9 months
[PATCH] Make the Welcome spoke wait for Geolocation lookup to finish (#975193)
by Martin Kolman
The GeoIP lookup usually takes between 1 to 2 seconds to finish.
In some cases, such as when running on a live system, the welcome spoke
might show up before the lookup can finish, so the result of the lookup
can not be used to pre-set the language.
To improve this, the geoloc module top level functions now have an
optional wait parameter, that makes the function block until the
lookup is is done or a timeout is reached.
The end result is, that the Welcome spoke will wait up to 3 seconds
for the lookup to finish. Usually it would wait less than 2 seconds or
not at all (if the lookup finishes before the welcome spoke is even
initialized).
Signed-off-by: Martin Kolman <mkolman(a)gmail.com>
---
pyanaconda/constants.py | 3 ++
pyanaconda/geoloc.py | 62 ++++++++++++++++++++++++++++++++-----
pyanaconda/ui/gui/spokes/welcome.py | 2 +-
3 files changed, 59 insertions(+), 8 deletions(-)
diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py
index ee9ffdb..175dc36 100644
--- a/pyanaconda/constants.py
+++ b/pyanaconda/constants.py
@@ -141,6 +141,9 @@ GEOLOC_GEOCODER_NOMINATIM = "geocoder_nominatim"
# default providers
GEOLOC_DEFAULT_PROVIDER = GEOLOC_PROVIDER_FEDORA_GEOIP
GEOLOC_DEFAULT_GEOCODER = GEOLOC_GEOCODER_NOMINATIM
+# timeout (in seconds)
+GEOLOC_TIMEOUT = 3
+
ANACONDA_ENVIRON = "anaconda"
FIRSTBOOT_ENVIRON = "firstboot"
diff --git a/pyanaconda/geoloc.py b/pyanaconda/geoloc.py
index 5a6da14..bb5619f 100644
--- a/pyanaconda/geoloc.py
+++ b/pyanaconda/geoloc.py
@@ -117,6 +117,11 @@ from pyanaconda import nm
location_info_instance = None
+# when waiting for result from geolocation,
+# how ofthen should we check if a result was returned or
+# if the timetout was reached (in seconds)
+GEOLOC_TIMEOUT_CHECK_INTERVAL = 0.2
+
def init_geolocation(provider_id=constants.GEOLOC_DEFAULT_PROVIDER):
"""Prepare the geolocation module for handling geolocation queries.
@@ -143,7 +148,7 @@ def refresh():
log.debug("Geoloc: refresh() called before init_geolocation()")
-def get_territory_code():
+def get_territory_code(wait=False):
"""This function returns the current country code
or None, if:
- no results were found
@@ -151,16 +156,17 @@ def get_territory_code():
- the geolocation module was not activated (init & refresh were not called)
- this is for example the case during image and directory installs
+ :param wait: wait for wait seconds for lookup in progress to finish
:return: current country code or None if not known
:rtype: string or None
"""
- if location_info_instance:
+ if _get_location_info_instance(wait):
return location_info_instance.get_territory_code()
else:
return None
-def get_timezone():
+def get_timezone(wait=False):
"""This function returns the current time zone
or None, if:
- no timezone was found
@@ -168,28 +174,29 @@ def get_timezone():
- the geolocation module was not activated (init & refresh were not called)
- this is for example the case during image and directory installs
+ :param wait: wait for wait seconds for lookup in progress to finish
:return: current timezone or None if not known
:rtype: string or None
"""
- if location_info_instance:
+ if _get_location_info_instance(wait):
return location_info_instance.get_timezone()
else:
return None
-def get_result():
+def get_result(wait=False):
"""Returns the current geolocation result wrapper
or None, if:
- no results were found
- the refresh is still in progress
- the geolocation module was not activated (init & refresh were not called)
-
- this is for example the case during image and directory installs
+ :param wait: wait for wait seconds for lookup in progress to finish
:return: LocationResult instance or None if location is unknown
:rtype: LocationResult or None
"""
- if location_info_instance:
+ if _get_location_info_instance(wait):
return location_info_instance.get_result()
else:
return None
@@ -236,6 +243,47 @@ def _get_provider(provider_id):
return provider()
+def _get_location_info_instance(wait=False):
+ """Just return instance of the location info object
+ and optionally wait for the Geolocation thread to finish
+
+ Meaning of the wait parameter:
+ - False or <=0: don't wait
+ - True : wait for default number of seconds specified by
+ the GEOLOC_TIMEOUT constant
+ - >0 - wait for a given number of seconds
+ :param wait: specifies if this function should wait
+ for the lookup to finish before returning the instance
+ :type wait: bool or integer
+
+ If there is no lookup in progress (no Geolocation refresh thread
+ is running, this function returns at once).
+ """
+
+ if wait:
+ # check if wait is boolean or a number
+ if wait is True:
+ wait = constants.GEOLOC_TIMEOUT
+ time_elapsed = 0
+ # first check if the geolocation thread is running
+ if threadMgr.get(constants.THREAD_GEOLOCATION_REFRESH):
+ while time_elapsed <= wait:
+ # refresh still in progress
+ if threadMgr.get(constants.THREAD_GEOLOCATION_REFRESH):
+ time.sleep(GEOLOC_TIMEOUT_CHECK_INTERVAL)
+ time_elapsed += GEOLOC_TIMEOUT_CHECK_INTERVAL
+ else:
+ break
+ else: # timed out
+ log.info("Waiting for Geolocation timed out after %d seconds."
+ % wait)
+ # please note that this does not mean that the actual
+ # geolocation lookup was stopped in any way, this will
+ # just unblock the caller after the given wait period
+ # even though the lookup thread is still running
+ return location_info_instance
+
+
class GeolocationError(Exception):
"""Exception class for geolocation related errors"""
pass
diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py
index 5c3a47f..fec9b68 100644
--- a/pyanaconda/ui/gui/spokes/welcome.py
+++ b/pyanaconda/ui/gui/spokes/welcome.py
@@ -156,7 +156,7 @@ class WelcomeLanguageSpoke(StandaloneSpoke):
# We can use the territory from geolocation here
# to preselect the translation, when it's available.
- territory = geoloc.get_territory_code()
+ territory = geoloc.get_territory_code(wait=True)
self.language = Language(LOCALE_PREFERENCES, territory=territory)
# check if there is one and only one locale for the territory
--
1.8.1.4
10 years, 9 months
[rhel6-branch] Only pass exclusiveDisks for autopart (#852523)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
If part --ondisk is combined with clearpart --drives the set of disks may
be different so we only need to pass exclusiveDisks for the autopart case.
(thanks to dlehman for the patch).
Resolves: rhbz#852523
---
storage/partitioning.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/storage/partitioning.py b/storage/partitioning.py
index e20a18f..2daa4bb 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -245,9 +245,14 @@ def doAutoPartition(anaconda):
log.warning("not sanity checking devices because I don't know how yet")
# run the autopart function to allocate and grow partitions
+ if anaconda.id.storage.doAutoPart:
+ exclusiveDisks = anaconda.id.storage.clearPartDisks[:]
+ else:
+ exclusiveDisks = None
+
try:
doPartitioning(anaconda.id.storage,
- exclusiveDisks=anaconda.id.storage.clearPartDisks)
+ exclusiveDisks=exclusiveDisks)
if anaconda.id.storage.doAutoPart:
_scheduleLVs(anaconda, devs)
--
1.8.1.4
10 years, 10 months
[master][PATCH] Wait for GeoIP lookup to finish
by Martin Kolman
From: Martin Kolman <mkolman(a)gmail.com>
The following patch makes the Welcome spoke wait for up to 3 seconds
for the GeoIP lookup to finish. Thats only the worst case, as the lookup
usually takes between 1.1 to 2 seconds. And in case the lookup finishes
before the Welcome spoke initialize() function is called (as it seems to be the
case on non-live installs), there will be no wait at all.
Also any feedback about the default 3 second timeout is welcome (too long/short ?).
(repost nr. 2, sending from zimbra as git send-email emails seem to get eaten for some reason)
Martin Kolman (1):
Make the Welcome spoke wait for Geolocation lookup to finish
pyanaconda/constants.py | 3 ++
pyanaconda/geoloc.py | 62 ++++++++++++++++++++++++++++++++-----
pyanaconda/ui/gui/spokes/welcome.py | 2 +-
3 files changed, 59 insertions(+), 8 deletions(-)
--
1.8.1.4
10 years, 10 months
[pykickstart/rhel6] Raise error on multiple clearpart commands (#852523)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
---
pykickstart/commands/clearpart.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pykickstart/commands/clearpart.py b/pykickstart/commands/clearpart.py
index 5d6276a..c2c14c7 100644
--- a/pykickstart/commands/clearpart.py
+++ b/pykickstart/commands/clearpart.py
@@ -81,6 +81,9 @@ class FC3_ClearPart(KickstartCommand):
return op
def parse(self, args):
+ if self.type is not None:
+ raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("clearpart already set"))
+
(opts, extra) = self.op.parse_args(args=args, lineno=self.lineno)
self._setToSelf(self.op, opts)
return self
--
1.8.1.4
10 years, 10 months
[rhel6-branch] Filter out /dev/sr* from list-harddrives (#847600)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
---
command-stubs/list-harddrives-stub | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/command-stubs/list-harddrives-stub b/command-stubs/list-harddrives-stub
index 16279f5..0b8a4e5 100755
--- a/command-stubs/list-harddrives-stub
+++ b/command-stubs/list-harddrives-stub
@@ -25,7 +25,8 @@ def main():
def get_devices():
devices = parted.getAllDevices()
- devices = [d for d in devices if d.type != parted.DEVICE_DM]
+ devices = [d for d in devices if d.type != parted.DEVICE_DM \
+ and not d.path.startswith('/dev/sr')]
for dev in devices:
path = dev.path[5:] if dev.path.startswith('/dev/') else dev.path
yield path, dev.getSize()
--
1.8.1.4
10 years, 10 months
[PATCH rhel6-branch] Write directly to /etc/sysconfig/network so that inotify works (#845572)
by Radek Vykydal
Resolves: rhbz#845572
Calling rename() on new temporary /etc/sysconfig/.network file used to break
inotify (IN_CLOSE_WRITE) mechanism on /etc/sysconfig/network file and therefore
update of system hostname by NM didn't work.
---
loader/net.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/loader/net.c b/loader/net.c
index 93a9c6f..ee83860 100644
--- a/loader/net.c
+++ b/loader/net.c
@@ -1579,7 +1579,7 @@ int writeEnabledNetInfo(iface_t *iface) {
}
/* Global settings */
- if ((fp = fopen(SYSCONFIG_PATH"/.network", "w")) == NULL) {
+ if ((fp = fopen(SYSCONFIG_PATH"/network", "w")) == NULL) {
return 9;
}
@@ -1619,15 +1619,11 @@ int writeEnabledNetInfo(iface_t *iface) {
}
#endif
+ /* This triggers NM's inotify mechanism for updating system hostname */
if (fclose(fp) == EOF) {
return 12;
}
- if (rename(SYSCONFIG_PATH"/.network",
- SYSCONFIG_PATH"/network") == -1) {
- return 15;
- }
-
return 0;
}
--
1.7.11.7
10 years, 10 months