[et-mgmt-tools] [PATCH] Fix traceback on commands run with -h

Michael DeHaan mdehaan at redhat.com
Tue Feb 19 15:44:07 UTC 2008


Jeremy Rosengren wrote:
> This patch should fix the traceback that occurs when you run a command 
> with -h (cobbler reposync -h).  Looking back through the history of 
> cobbler.py, it looked like a simple matter of the conditional 
> expressions becoming reversed in a recent commit.

cobbler reposync -h works for me as is, from latest git, and in the 
released version.

What version of Cobbler are you using (rpm -q cobbler)? 

The code in question below is already correct, because it prints the 
traceback only for non-cobbler ("CX") exceptions.

--Michael


>
> Thanks,
>
> -- jeremy
>
> ---
> cobbler/cobbler.py |    4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/cobbler/cobbler.py b/cobbler/cobbler.py
> index fb9b273..0f201f7 100755
> --- a/cobbler/cobbler.py
> +++ b/cobbler/cobbler.py
> @@ -56,9 +56,9 @@ def main():
>         print str(exc)[1:-1]  # remove framing air quotes
>     except Exception, exc2:
>         if str(type(exc2)).find("CX") == -1:
> -            traceback.print_exc()
> -        else:
>             print str(exc2)[1:-1]  # remove framing air quotes
> +        else:
> +            traceback.print_exc()
>         return 1
>     return 1
>
> -- 
> 1.5.2.1
>
> _______________________________________________
> et-mgmt-tools mailing list
> et-mgmt-tools at redhat.com
> https://www.redhat.com/mailman/listinfo/et-mgmt-tools




More information about the et-mgmt-tools mailing list