[PATCH 1/4] vmcore: don't fail if /etc/kdump.conf is not readable
Jiri Moskovcak
jmoskovc at redhat.com
Mon Sep 2 11:01:20 UTC 2013
On 09/02/2013 11:26 AM, Richard Marko wrote:
> Signed-off-by: Richard Marko <rmarko at redhat.com>
> ---
> src/hooks/abrt_harvest_vmcore.py.in | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/src/hooks/abrt_harvest_vmcore.py.in b/src/hooks/abrt_harvest_vmcore.py.in
> index 4f2e1d0..f2ac4eb 100644
> --- a/src/hooks/abrt_harvest_vmcore.py.in
> +++ b/src/hooks/abrt_harvest_vmcore.py.in
> @@ -47,10 +47,17 @@ def parse_kdump():
> This function parses /etc/kdump.conf to get a path to kdump's
> dump directory.
> """
> + # default
> + dump_path = '/var/crash'
>
> # filesystem types that can be used by kdump for dumping
> fs_types = ['ext4', 'ext3', 'ext2', 'minix', 'btrfs', 'xfs']
>
> + if not os.access('/etc/kdump.conf', os.R_OK):
> + sys.stderr.write("/etc/kdump.conf not readable, using "
> + "default path '%s'\n" % dump_path)
> + return dump_path
> +
- please factor out the logging functions from abrt-action-analyze-core
script and use it in both scripts
- they also exists in the reportclient module in libreport, so maybe you
can use them instead of creating just another abrt module
> with open('/etc/kdump.conf') as conf_file:
> kdump_conf = conf_file.read()
>
> @@ -59,9 +66,6 @@ def parse_kdump():
> result = regexp.search(kdump_conf)
> if result:
> dump_path = result.group(1).strip()
> - else:
> - # default
> - dump_path = '/var/crash'
>
> # default
> partition = None
>
More information about the Crash-catcher
mailing list