[rhel7] Avoid raising an exception if epdb module unavailable (#1026779)

Vratislav Podzimek vpodzime at redhat.com
Wed Nov 6 14:08:18 UTC 2013


On Wed, 2013-11-06 at 08:17 -0500, mulhern wrote:
> Resolves: rhbz#1026779
> 
> Catch the exception and print an informative log message if the import fails.
> The startDebugging method is a convenience for developers, and this seemed
> to be the most useful approach for those I talked to.
> 
> With this approach, if the developer wants
> to load epdb into their updates.img file they can still use the HUP signal
> functionality without further edits.
> 
> Signed-off-by: mulhern <amulhern at redhat.com>
> ---
>  anaconda | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/anaconda b/anaconda
> index ce37365..fd9c507 100755
> --- a/anaconda
> +++ b/anaconda
> @@ -414,8 +414,11 @@ def check_memory(anaconda, opts, display_mode=None):
>                  time.sleep(2)
>  
>  def startDebugger(signum, frame):
> -    import epdb
> -    epdb.serve(skip=1)
> +    try:
> +        import epdb
> +        epdb.serve(skip=1)
> +    except ImportError:
> +        log.info("Failed to start epdb remote debugging; epdb module import failed")
I'd use log.error() in this case, but otherwise ACK.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list