[rhel5-branch] New version of the gfs support patch and one more
by Vratislav Podzimek
First!
PATCH 1/2 is the same as the previous attempt for the gfs support. However,
the previous version had self.check set to 1 that caused problems on reboot
because fsck.gfs failed. I believe 0 is the right value here.
PATCH 2/2 adds the unknownFileSystem class that allows us to just comment
out the fstab lines with unknown (not supported) filesystem on upgrade. We
could just copy such lines, but that may result in non-booting system,
because of for example fsck problems (fsck for such filesystem may be not
installed or whatever). Ending up in a shell during boot process is a lot
worse then fixing the configuration from the running system with all utilities
available.
--
Vratislav Podzimek
11 years, 9 months
[rhel7/newui/master] Let kickstart users log to device nodes (#835563)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
If a kickstart pre/post fails we read the logfile and add it to the
anaconda log. This doesn't work well for device nodes like /dev/console
so skip reading if it is a device node.
Resolves: rhbz#835563
---
pyanaconda/kickstart.py | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index d3648e5..22f4481 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -87,7 +87,7 @@ class AnacondaKSScript(Script):
# pick where it goes. The script will also be logged to program.log
# because of execWithRedirect, and to anaconda.log if the script fails.
if self.logfile:
- if self.inChroot:
+ if self.inChroot and not self.logfile.startswith("/dev/"):
messages = "%s/%s" % (scriptRoot, self.logfile)
else:
messages = self.logfile
@@ -111,15 +111,16 @@ class AnacondaKSScript(Script):
if rc != 0:
log.error("Error code %s running the kickstart script at line %s" % (rc, self.lineno))
- try:
- f = open(messages, "r")
- except IOError as e:
- err = None
- else:
- err = f.readlines()
- f.close()
- for l in err:
- log.error("\t%s" % l)
+ if not messages.startswith("/dev/"):
+ try:
+ f = open(messages, "r")
+ except IOError as e:
+ err = None
+ else:
+ err = f.readlines()
+ f.close()
+ for l in err:
+ log.error("\t%s" % l)
if self.errorOnFail:
if intf != None:
--
1.7.7.6
11 years, 9 months
[PATCH] update proxy support
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
cmdline proxy strings use the standard form:
[protocol://][username[:password]@]host[:port]
proxy url strings are stored in the ksdata, either in method.proxy for
the global proxy or per repo in repo.proxy
ProxyString handles parsing the proxy url and returning it in various
forms useful for urlgrabber, yum and the UI.
--proxyAuth has been removed. It has no meaning with noloader.
Also fix a typo with sslverify in the repo configuration file.
---
anaconda | 16 ++----
pyanaconda/iutil.py | 104 ++++++++++++++++++++++++++++++++++++
pyanaconda/packaging/__init__.py | 15 ++++--
pyanaconda/packaging/yumpayload.py | 54 ++++++++++++++-----
pyanaconda/ui/gui/spokes/source.py | 61 +++++++++++----------
5 files changed, 191 insertions(+), 59 deletions(-)
diff --git a/anaconda b/anaconda
index c613d4e..b324539 100755
--- a/anaconda
+++ b/anaconda
@@ -233,7 +233,6 @@ def parseOptions(argv=None, cmdline=None):
op.add_option("--noipv4", action="store_true", default=False)
op.add_option("--noipv6", action="store_true", default=False)
op.add_option("--proxy")
- op.add_option("--proxyAuth")
# Method of operation
op.add_option("--autostep", action="store_true", default=False)
@@ -781,15 +780,6 @@ if __name__ == "__main__":
if opts.proxy:
anaconda.proxy = opts.proxy
- if opts.proxyAuth:
- filename = opts.proxyAuth
- ret = open(filename, "r").readlines()
- os.unlink(filename)
-
- anaconda.proxyUsername = ret[0].rstrip()
- if len(ret) == 2:
- anaconda.proxyPassword = ret[1].rstrip()
-
if opts.updateSrc:
anaconda.updateSrc = opts.updateSrc
@@ -873,6 +863,10 @@ if __name__ == "__main__":
# scripts. Add those to the ksdata now.
kickstart.appendPostScripts(ksdata)
+ # cmdline flags override kickstart settings
+ ksdata.method.proxy = anaconda.proxy
+ ksdata.method.noverifyssl = flags.noverifyssl
+
# set ksdata.method based on anaconda.method if it isn't already set
if anaconda.methodstr and not ksdata.method.method:
if anaconda.methodstr.startswith("cdrom"):
@@ -901,8 +895,6 @@ if __name__ == "__main__":
elif anaconda.methodstr.startswith("http") or \
anaconda.methodstr.startswith("ftp"):
ksdata.method.method = "url"
- ksdata.method.noverifyssl = flags.noverifyssl
- ksdata.method.proxy = anaconda.proxy # FIXME: username/password
ksdata.method.url = anaconda.methodstr
# setup keyboard layout from the command line option and let
diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
index 398ef77..1228946 100644
--- a/pyanaconda/iutil.py
+++ b/pyanaconda/iutil.py
@@ -28,6 +28,7 @@ import os.path
import errno
import subprocess
import threading
+import re
from flags import flags
from constants import *
@@ -1081,3 +1082,106 @@ def dracut_eject(device):
except Exception, e:
log.error("Error writing dracut shutdown eject hook for %s: %s" % (device, e))
+class ProxyStringError(Exception):
+ pass
+
+class ProxyString(object):
+ """ Handle a proxy url
+ """
+ def __init__(self, url=None, protocol="http://", host=None, port="3128",
+ username=None, password=None):
+ """ Initialize with either url
+ ([protocol://][username[:password]@]host[:port]) or pass host and
+ optionally:
+
+ protocol http, https, ftp
+ host hostname without protocol
+ port port number (defaults to 3128)
+ username username
+ password password
+
+ The str() of the object is the full proxy url
+
+ ProxyString.url is the full url including username:password@
+ ProxyString.noauth_url is the url without username:password@
+ """
+ self.url = url
+ self.protocol = protocol
+ self.host = host
+ self.port = str(port)
+ self.username = username
+ self.password = password
+ self.proxy_auth = ""
+ self.noauth_url = None
+
+ if url:
+ self.parse_url()
+ elif not host:
+ raise ProxyStringError("No host url")
+ else:
+ self.parse_components()
+
+ def parse_url(self):
+ """ Parse the proxy url into its component pieces
+ """
+ # NOTE: If this changes, update tests/regex/proxy.py
+ #
+ # proxy=[protocol://][username[:password]@]host[:port][path]
+ # groups
+ # 1 = protocol
+ # 2 = username:password@
+ # 3 = username
+ # 4 = password
+ # 5 = hostname
+ # 6 = port
+ # 7 = extra
+ pattern = re.compile("([A-Za-z]+://)?(([A-Za-z0-9]+)(:[^:@]+)?@)?([^:/]+)(:[0-9]+)?(/.*)?")
+ m = pattern.match(self.url)
+ if not m:
+ raise ProxyStringError("malformed url, cannot parse it.")
+
+ # If no protocol was given default to http.
+ if m.group(1):
+ self.protocol = m.group(1)
+ else:
+ self.protocol = "http://"
+
+ if m.group(3):
+ self.username = m.group(3)
+
+ if m.group(4):
+ # Skip the leading colon
+ self.password = m.group(4)[1:]
+
+ if m.group(5):
+ self.host = m.group(5)
+ if m.group(6):
+ # Skip the leading colon
+ self.port = m.group(6)[1:]
+ else:
+ raise ProxyStringError("url has no host component")
+
+ self.parse_components()
+
+ def parse_components(self):
+ """ Parse the components of a proxy url into url and noauth_url
+ """
+ if self.username or self.password:
+ self.proxy_auth = "%s:%s@" % (self.username or "",
+ self.password or "")
+
+ self.url = self.protocol + self.proxy_auth + self.host + ":" + self.port
+ self.noauth_url = self.protocol + self.host + ":" + self.port
+
+ @property
+ def dict(self):
+ """ return a dict of all the elements of the proxy string
+ url, noauth_url, protocol, host, port, username, password
+ """
+ components = ["url", "noauth_url", "protocol", "host", "port",
+ "username", "password"]
+ return dict([(k, getattr(self, k)) for k in components])
+
+ def __str__(self):
+ return self.url
+
diff --git a/pyanaconda/packaging/__init__.py b/pyanaconda/packaging/__init__.py
index 8b56268..ca23f53 100644
--- a/pyanaconda/packaging/__init__.py
+++ b/pyanaconda/packaging/__init__.py
@@ -43,6 +43,7 @@ from pyanaconda.constants import *
from pyanaconda.flags import flags
from pyanaconda import iutil
+from pyanaconda.iutil import ProxyString, ProxyStringError
from pykickstart.parser import Group
@@ -118,8 +119,9 @@ def get_mount_device(mountpoint):
class Payload(object):
""" Payload is an abstract class for OS install delivery methods. """
def __init__(self, data):
+ """ data is a kickstart.AnacondaKSHandler class
+ """
self.data = data
- self.proxy = None
self._kernelVersionList = []
def setup(self, storage):
@@ -378,9 +380,14 @@ class Payload(object):
version))
proxies = {}
- if self.proxy:
- proxies = {"http": self.proxy,
- "https": self.proxy}
+ if self.data.method.proxy:
+ try:
+ proxy = ProxyString(self.data.method.proxy)
+ proxies = {"http": proxy.url,
+ "https": proxy.url}
+ except ProxyStringError as e:
+ log.info("Failed to parse proxy for _getReleaseVersion %s: %s" \
+ % (self.data.method.proxy, e))
treeinfo = self._getTreeInfo(url, not flags.noverifyssl, proxies)
if treeinfo:
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 1482125..9ab8d32 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -61,6 +61,7 @@ from pyanaconda.constants import *
from pyanaconda.flags import flags
from pyanaconda import iutil
+from pyanaconda.iutil import ProxyString, ProxyStringError
from pyanaconda import isys
from pyanaconda.network import hasActiveNetDev
@@ -100,7 +101,6 @@ class YumPayload(PackagePayload):
PackagePayload.__init__(self, data)
self.install_device = None
- self.proxy = None # global proxy
self._root_dir = "/tmp/yum.root"
self._repos_dir = "/etc/yum.repos.d,/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anaconda.repos.d"
self._yum = None
@@ -142,8 +142,7 @@ class YumPayload(PackagePayload):
self._resetYum(root=root)
- def setup(self, storage, proxy=None):
- self.proxy = proxy
+ def setup(self, storage):
self._writeYumConfig()
self._setup = True
@@ -201,9 +200,17 @@ reposdir=%s
if flags.noverifyssl:
buf += "sslverify=0\n"
- if self.proxy:
- # FIXME: include proxy_username, proxy_password
- buf += "proxy=%s\n" % proxy
+ if self.data.method.proxy:
+ try:
+ proxy = ProxyString(self.data.method.proxy)
+ buf += "proxy=%s\n" % (proxy.noauth_url,)
+ if proxy.username:
+ buf += "proxy_username=%s\n" % (proxy.username,)
+ if proxy.password:
+ buf += "proxy_password=%s\n" % (proxy.password,)
+ except ProxyStringError as e:
+ log.error("Failed to parse proxy for _writeYumConfig %s: %s" \
+ % (self.data.method.proxy, e))
open("/tmp/anaconda-yum.conf", "w").write(buf)
@@ -250,10 +257,19 @@ reposdir=%s
# kickstart repo modifiers
if ks_repo:
if ks_repo.noverifyssl:
- f.write("verifyssl=0\n")
+ f.write("sslverify=0\n")
if ks_repo.proxy:
- f.write("proxy=%s\n" % ks_repo.proxy)
+ try:
+ proxy = ProxyString(ks_repo.proxy)
+ f.write("proxy=%s\n" % (proxy.noauth_url,))
+ if proxy.username:
+ f.write("proxy_username=%s\n" % (proxy.username,))
+ if proxy_password:
+ f.write("proxy_password=%s\n" % (proxy.password,))
+ except ProxyStringError as e:
+ log.error("Failed to parse proxy for _writeInstallConfig %s: %s" \
+ % (self.data.method.proxy, e))
if ks_repo.cost:
f.write("cost=%d\n" % ks_repo.cost)
@@ -485,7 +501,6 @@ reposdir=%s
method = self.data.method
sslverify = True
url = None
- proxy = None
if method.method == "harddrive":
if method.biospart:
@@ -527,7 +542,6 @@ reposdir=%s
elif method.method == "url":
url = method.url
sslverify = not (method.noverifyssl or flags.noverifyssl)
- proxy = method.proxy or self.proxy
elif method.method == "cdrom" or not method.method:
# cdrom or no method specified -- check for media
device = opticalInstallMedia(storage.devicetree)
@@ -545,7 +559,7 @@ reposdir=%s
self._yumCacheDirHack()
try:
self._addYumRepo(BASE_REPO_NAME, url,
- proxy=proxy, sslverify=sslverify)
+ proxyurl=method.proxy, sslverify=sslverify)
except MetadataError as e:
log.error("base repo (%s/%s) not valid -- removing it"
% (method.method, url))
@@ -565,13 +579,13 @@ reposdir=%s
if self._repoNeedsNetwork(repo) and not hasActiveNetDev():
raise NoNetworkError
- proxy = repo.proxy or self.proxy
+ proxy = repo.proxy or self.data.method.proxy
sslverify = not (flags.noverifyssl or repo.noverifyssl)
# this repo is already in ksdata, so we only add it to yum here
self._addYumRepo(repo.name, url, repo.mirrorlist, cost=repo.cost,
exclude=repo.excludepkgs, includepkgs=repo.includepkgs,
- proxy=proxy, sslverify=sslverify)
+ proxyurl=proxy, sslverify=sslverify)
# TODO: enable addons via treeinfo
@@ -599,7 +613,7 @@ reposdir=%s
except RepoMDError:
log.error("failed to get groups for repo %s" % yumrepo.id)
- def _addYumRepo(self, name, baseurl, mirrorlist=None, **kwargs):
+ def _addYumRepo(self, name, baseurl, mirrorlist=None, proxyurl=None, **kwargs):
""" Add a yum repo to the YumBase instance. """
from yum.Errors import RepoError
@@ -607,6 +621,18 @@ reposdir=%s
if name in self._yum.repos.repos:
self._yum.repos.delete(name)
+ if proxyurl:
+ try:
+ proxy = ProxyString(proxyurl)
+ kwargs["proxy"] = proxy.noauth_url
+ if proxy.username:
+ kwargs["proxy_username"] = proxy.username
+ if proxy.password:
+ kwargs["proxy_password"] = proxy.password
+ except ProxyStringError as e:
+ log.error("Failed to parse proxy for _addYumRepo %s: %s" \
+ % (proxyurl, e))
+
log.debug("adding yum repo %s with baseurl %s and mirrorlist %s"
% (name, baseurl, mirrorlist))
with _yum_lock:
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 9a87c03..7752439 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -24,6 +24,9 @@ import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
N_ = lambda x: x
+import logging
+log = logging.getLogger("anaconda")
+
import os.path
from gi.repository import AnacondaWidgets, GLib, Gtk
@@ -33,6 +36,7 @@ from pyanaconda.ui.gui import UIObject, communication
from pyanaconda.ui.gui.spokes import NormalSpoke
from pyanaconda.ui.gui.categories.software import SoftwareCategory
from pyanaconda.ui.gui.utils import enlightbox, gdk_threaded
+from pyanaconda.iutil import ProxyString, ProxyStringError
__all__ = ["SourceSpoke"]
@@ -57,15 +61,23 @@ class ProxyDialog(UIObject):
self.window.destroy()
return
- proxy = self._proxyURLEntry.get_text()
+ url = self._proxyURLEntry.get_text()
+ if self._authCheck.get_active():
+ username = self._proxyPasswordEntry.get_text()
+ password = self._proxyPasswordEntry.get_text()
+ else:
+ username = None
+ password = None
- if self._authCheck.get_active() and self._proxyUsernameEntry.get_text():
- if self._proxyPasswordEntry.get_text():
- proxy = self._proxyUsernameEntry.get_text() + ":" + self._proxyPasswordEntry.get_text() + "@" + proxy
- else:
- proxy = self._proxyUsernameEntry.get_text() + "@" + proxy
+ try:
+ proxy = ProxyString(url=url, username=username, password=password)
+ self.data.method.proxy = proxy.url
+ except ProxyStringError as e:
+ log.error("Failed to parse proxy for ProxyDialog Add - %s:%s@%s: %s" \
+ % (username, password, url, e))
+ # TODO - tell the user they entered an invalid proxy and let them retry
+ self.data.method.proxy = ""
- self.data.method.proxy = proxy
self.window.destroy()
def on_proxy_enable_toggled(self, button, *args):
@@ -95,28 +107,19 @@ class ProxyDialog(UIObject):
self.on_proxy_auth_toggled(self._authCheck)
return
- # proxy=[protocol://][username[:password]@]host[:port][path]
- pattern = re.compile("([A-Za-z]+://)?(([A-Za-z0-9]+)(:[^:@]+)?@)?([^:/]+)(:[0-9]+)?(/.*)?")
- m = pattern.match(self.data.method.proxy)
-
- if m and m.group(3):
- self._proxyUsernameEntry.set_text(m.group(3))
- if m and m.group(4):
- # Skip the leading colon.
- self._proxyPasswordEntry.set_text(m.group(4)[1:])
- if m and m.group(5):
- # If both a host and port was found, just paste them
- # together using the colon at the beginning of the port
- # match as a separator. Otherwise, just use the host.
- if m.group(6):
- proxy = m.group(5) + m.group(6)
- else:
- proxy = m.group(5)
-
- self._proxyURLEntry.set_text(proxy)
+ try:
+ proxy = ProxyString(self.data.method.proxy)
+ if proxy.username:
+ self._proxyUsernameEntry.set_text(proxy.username)
+ if proxy.password:
+ self._proxyPasswordEntry.set_text(proxy.password)
+ self._proxyURLEntry.set_text(proxy.noauth_url)
+ except ProxyStringError as e:
+ log.error("Failed to parse proxy for ProxyDialog.refresh %s: %s" % (self.data.method.proxy, e))
+ return
- self._proxyCheck.set_active(self.data.method.proxy != "")
- self._authCheck.set_active("@" in self.data.method.proxy)
+ self._proxyCheck.set_active(True)
+ self._authCheck.set_active(bool(proxy.username or proxy.password))
self.on_proxy_enable_toggled(self._proxyCheck)
self.on_proxy_auth_toggled(self._authCheck)
@@ -816,5 +819,5 @@ class SourceSpoke(NormalSpoke):
# Only allow the proxy button to be clicked if a proxy makes sense for
# the currently selected protocol.
- proxyButton.set_sensitive(self._http_active())
+ proxyButton.set_sensitive(self._http_active() or self._mirror_active())
nfsOptsBox.set_visible(self._nfs_active())
--
1.7.7.6
11 years, 9 months
[PATCH rhel6-branch] Remove unnecessary BOOTPROTO line from ifcfg files (#819486)
by Jesse Keating
BOOTPROTO=static is redundant. The default is static, BOOTPROTO only
makes sense if doing dhcp or some such. In this case, BOOTPROTO=static
existing and no ipv4 definition is confusing ifcfg-rh (from
NetworkManager) and preventing the device from being brought up.
---
loader/linuxrc.s390 | 1 -
1 file changed, 1 deletion(-)
diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390
index 2c72b9e..c54ca93 100644
--- a/loader/linuxrc.s390
+++ b/loader/linuxrc.s390
@@ -3001,7 +3001,6 @@ fi
cat > $IFCFGFILE << EOF
DEVICE=$DEVICE
ONBOOT=yes
-BOOTPROTO=static
MTU=$MTU
SUBCHANNELS=$SUBCHANNELS
EOF
--
1.7.10.2
11 years, 9 months
[PATCH] replace lokkit for selinux settings (#815540)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
lokkit is going to be going away. This adds our own configuration editor
class and switches to using that to edit the selinux setting.
---
pyanaconda/iutil.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++
pyanaconda/security.py | 12 ++++------
2 files changed, 59 insertions(+), 7 deletions(-)
diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
index 398ef77..d6a8e76 100644
--- a/pyanaconda/iutil.py
+++ b/pyanaconda/iutil.py
@@ -28,6 +28,7 @@ import os.path
import errno
import subprocess
import threading
+import tempfile
from flags import flags
from constants import *
@@ -1081,3 +1082,56 @@ def dracut_eject(device):
except Exception, e:
log.error("Error writing dracut shutdown eject hook for %s: %s" % (device, e))
+class EditConfig(object):
+ """
+ Edit values in a configuration file without changing comments.
+ Supports KEY=VALUE lines and ignores everything else.
+ Does not allow adding or deleting keys.
+ Does not support duplicate key entries.
+
+ ec = EditConfig("/path/to/file")
+ ec.values is a dict of keys from the file, edit as needed then call:
+ ec.write()
+
+ """
+ def __init__(self, filename):
+ """ filename is the full path of the file to edit
+ """
+ self.filename = filename
+ self.values = {}
+ self.read()
+
+ def read(self):
+ """ Read the config file and store the key/value pairs
+ """
+ with open(self.filename) as f:
+ for line in f:
+ if len(line)>0 and line[0] in '#";':
+ continue
+ (key, sep, var) = [x.strip() for x in line.partition("=")]
+ if key and sep == "=":
+ self.values[key] = var
+
+ def write(self):
+ """ Rewrite the file with the new key/value pairs
+ pass-thru comments and lines without =
+ """
+ tmpf = tempfile.NamedTemporaryFile(mode="w", delete=False)
+ with open(self.filename) as f:
+ for line in f:
+ if len(line)>0 and line[0] in '#";':
+ tmpf.write(line)
+ continue
+ (key, sep, var) = [x.strip() for x in line.partition("=")]
+ if key in self.values and sep == "=":
+ tmpf.write("%s=%s\n" % (key, self.values[key]))
+ continue
+ tmpf.write(line)
+ tmpf.close()
+
+ # Move the temporary file (with 0600 permissions) over the top of the
+ # original and preserve the original's permissions
+ m = os.stat(self.filename)
+ shutil.move(tmpf.name, self.filename)
+ os.chmod(self.filename, m.st_mode)
+
diff --git a/pyanaconda/security.py b/pyanaconda/security.py
index 50d92e2..b7d8dcc 100644
--- a/pyanaconda/security.py
+++ b/pyanaconda/security.py
@@ -65,14 +65,12 @@ class Security:
log.error("unknown selinux state: %s" %(self.selinux,))
return
- args = args + [ "--selinux=%s" %(selinux_states[self.selinux],) ]
-
try:
- iutil.execWithRedirect("/usr/sbin/lokkit", args,
- root=ROOT_PATH, stdout="/dev/null",
- stderr="/dev/null")
- except (RuntimeError, OSError) as msg:
- log.error ("lokkit run failed: %s" %(msg,))
+ selinux_cfg = iutil.EditConfig(ROOT_PATH+"/etc/selinux/config")
+ selinux_cfg.values["SELINUX"] = selinux_states[self.selinux]
+ selinux_cfg.write()
+ except IOError as msg:
+ log.error ("Error setting selinux mode: %s" %(msg,))
args = ["--update", "--nostart"] + shlex.split(self.auth)
if self._addFingerprint():
--
1.7.7.6
11 years, 9 months
[newui] patch dump
by David Lehman
All storage related. Lots to do with uninitialized disk handling.
11 years, 9 months
Take 3 on patch for read-only disks
by Jesse Keating
This includes some new code to really narrow it down to disk devices. This
might be able to use shared code in the future that's going into newui but
not yet.
It will also have to be backported to RHEL6 but that'll be a different patch.
-jlk
11 years, 9 months
Share code to fetch IP
by Jesse Keating
The sys.exit(1) in vnc.py will eventually change to a raise in newui, but for
now follows the example of other simliar code in vnc.py
-jlk
11 years, 9 months
[PATCH] Add readonly disks to the ignored list (#772977)
by Jesse Keating
If your disk is read-only, we're just going to flat out ignore it and
not offer it to you for anything.
---
pyanaconda/storage/devicetree.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index 4cd16cf..4db162e 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -596,6 +596,13 @@ class DeviceTree(object):
self.addIgnoredDisk(name)
return True
+ # Ignore any readonly disks
+ if udev_device_is_disk(info):
+ if iutil.get_sysfs_attr(info["sysfs_path"], 'ro') == '1':
+ log.debug("Ignoring read only device %s" % name)
+ self.addIgnoredDisk(name)
+ return True
+
# FIXME: check for virtual devices whose slaves are on the ignore list
def addUdevLVDevice(self, info):
--
1.7.10.2
11 years, 9 months
[PATCH] verify package cehcksums against metadata (#681224)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
Anaconda uses yum's getPackage() function to grab packages. It needs to
have a function passed to it in order to verify the package checksum
against the metadata.
Resolves: rhbz#681224
---
yuminstall.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/yuminstall.py b/yuminstall.py
index 61a0b65..57f826a 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -177,7 +177,8 @@ class AnacondaCallback:
while self.openfile is None:
trynumber += 1
try:
- fn = repo.getPackage(po)
+ checkfunc = (self.ayum.verifyPkg, (po, 1), {})
+ fn = repo.getPackage(po, checkfunc=checkfunc)
f = open(fn, 'r')
self.openfile = f
@@ -185,6 +186,9 @@ class AnacondaCallback:
self.ayum._handleFailure(po, trynumber)
except IOError:
self.ayum._handleFailure(po, trynumber)
+ except URLGrabError as e:
+ log.error("URLGrabError: %s" % (e,))
+ self.ayum._handleFailure(po, trynumber)
except yum.Errors.RepoError, e:
continue
self.inProgressPo = po
--
1.7.7.6
11 years, 9 months