Re: [Freeipa-devel] [PATCH 0411] upgrade: log to ipaupgrade.log if ipa is not installed

2016-02-11 Thread Martin Babinsky

On 01/29/2016 10:48 AM, Martin Basti wrote:

Missing record in ipaupgrade.log that upgrade failed because IPA is not
installed, causes harder time to debugging upgrade from log.

Patch attached.



ACK.

--
Martin^3 Babinsky

--
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code


Re: [Freeipa-devel] [PATCH 0411] upgrade: log to ipaupgrade.log if ipa is not installed

2016-02-11 Thread Martin Basti



On 11.02.2016 18:34, Martin Babinsky wrote:

On 01/29/2016 10:48 AM, Martin Basti wrote:

Missing record in ipaupgrade.log that upgrade failed because IPA is not
installed, causes harder time to debugging upgrade from log.

Patch attached.



ACK.


Pushed to master: 0ea7433d09e24904a06d6ed02c9a89b1ea4bbc43

--
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code


Re: [Freeipa-devel] [PATCH 0411] upgrade: log to ipaupgrade.log if ipa is not installed

2016-02-01 Thread Martin Basti



On 29.01.2016 12:12, Martin Kosek wrote:

On 01/29/2016 10:48 AM, Martin Basti wrote:

Missing record in ipaupgrade.log that upgrade failed because IPA is not
installed, causes harder time to debugging upgrade from log.

Patch attached.

I am thinking that in these general catch-all clauses, it could be also useful
to print the stack trace in the DEBUG log, especially for the cases when the
exception is re-raised to some general one, like here:

 try:
 data_upgrade.create_instance()
...
 except RuntimeError:
 raise RuntimeError('IPA upgrade failed.', 1)


It is already logged to DEBUG log in data_upgrade instance.

--
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code


Re: [Freeipa-devel] [PATCH 0411] upgrade: log to ipaupgrade.log if ipa is not installed

2016-01-29 Thread Martin Kosek
On 01/29/2016 10:48 AM, Martin Basti wrote:
> Missing record in ipaupgrade.log that upgrade failed because IPA is not
> installed, causes harder time to debugging upgrade from log.
> 
> Patch attached.

I am thinking that in these general catch-all clauses, it could be also useful
to print the stack trace in the DEBUG log, especially for the cases when the
exception is re-raised to some general one, like here:

try:
data_upgrade.create_instance()
...
except RuntimeError:
raise RuntimeError('IPA upgrade failed.', 1)

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code


[Freeipa-devel] [PATCH 0411] upgrade: log to ipaupgrade.log if ipa is not installed

2016-01-29 Thread Martin Basti
Missing record in ipaupgrade.log that upgrade failed because IPA is not 
installed, causes harder time to debugging upgrade from log.


Patch attached.
From f457b0996fcc8d6a6e0bf95763a25b518e370501 Mon Sep 17 00:00:00 2001
From: Martin Basti 
Date: Wed, 27 Jan 2016 15:09:32 +0100
Subject: [PATCH] Upgrade: log to ipaupgrade.log when IPA server is not
 installed

Message was printed only to stdout and leaves ipaupgrade.log without any
record that ipa-server-upgrade failed because ipa server is not
installed.
Now error is passed to logger which prints meassage to stderr and
ipaupgrade.log.
---
 ipaserver/install/server/upgrade.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipaserver/install/server/upgrade.py b/ipaserver/install/server/upgrade.py
index 20379f19c652cb0b5911a4c2f1c67eae7f763379..844a2a3fb597fe0b2e6aca6f7e81e06142314d72 100644
--- a/ipaserver/install/server/upgrade.py
+++ b/ipaserver/install/server/upgrade.py
@@ -1647,7 +1647,7 @@ def upgrade_check(options):
 try:
 installutils.check_server_configuration()
 except RuntimeError as e:
-print(unicode(e))
+root_logger.error(e)
 sys.exit(1)
 
 try:
-- 
2.5.0

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code