Re: [Freeipa-users] What does the u mean in IPA messages?

2013-03-04 Thread Petr Viktorin

On 03/01/2013 10:30 PM, John Dennis wrote:

On 03/01/2013 04:01 PM, John Dennis wrote:

On 03/01/2013 03:17 PM, KodaK wrote:

On Thu, Feb 28, 2013 at 5:01 PM, John Dennis jden...@redhat.com wrote:

On 02/28/2013 05:34 PM, KodaK wrote:



BTW, why are you parsing diagnostic output?


I haven't actually started yet, I was just getting my bearings.

I was going to wrap the commands in some scripts so I can do things
like allow an auditor to view the results of an HBAC test without
being able to modify them.  Among other things.  Is there a way to
turn off the diagnostic messages?  They appear to be on by default.



INFO messages are output when the verbose flag is enabled
DEBUG messages are output when the debug flag is enabled

Those flags can either be set in a config file (/etc/ipa/default.conf or
~/.ipa/default.con) or via a command line argument.

If you haven't passed the verbose flag to the command then it must be
set in one of the config files.

Petr Viktorin pvikt...@redhat.com recently cleaned up how messages are
managed in the command line tools (I don't think this has made it out
into a public release yet). So there may be changes coming you'll want
to be aware of, perhaps Petr might fill us in on what's different.

I think we had some client tools that forced verbose to be enabled when
it should have respected a command line option and/or config option. I
think that's some of what Petr fixed.



Here is the design document for the work Petr did, HTH

http://freeipa.org/page/V3/Logging_and_output


I don't think it's too relevant here. Those changes are mainly for 
install/management tools, and they're only in ipa-ldap-updater and 
ipa-replica-prepare commands so far.


As for future changes: no, we don't have any guarantees on diagnostic 
messages, and I don't think catering to parsers should prevent us from 
improving them.



Anyway, do you really need to parse debug messages to get HBAC test 
results? I think I don't understand your use case enough to suggest 
something better.


--
PetrĀ³

___
Freeipa-users mailing list
Freeipa-users@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-users


Re: [Freeipa-users] What does the u mean in IPA messages?

2013-03-01 Thread nick hatch
On Thu, Feb 28, 2013 at 3:01 PM, John Dennis jden...@redhat.com wrote:

 BTW, why are you parsing diagnostic output?  They are not part of the
 official API. We do not have any consistency rules for INFO and DEBUG
 messages, they can change at any time and often do. On the other hand
 command output is fairly consistent and not subject to the capricious whims
 of developers.

Not the original poster, but parsing log events is commonly done prior
to saving them in a structured data store as a transitional measure
while efforts like CEE and Project Lumberjack [1] stabilize.

For example, the popular Logstash project provides a library of
patterns for common services [2]. For users who parse FreeIPA logs,
frequent log formatting changes could be disruptive.

-n

[1] https://fedorahosted.org/lumberjack/
[2] http://logstash.net/docs/1.1.9/filters/grok

___
Freeipa-users mailing list
Freeipa-users@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-users


Re: [Freeipa-users] What does the u mean in IPA messages?

2013-03-01 Thread Rob Crittenden

nick hatch wrote:

On Thu, Feb 28, 2013 at 3:01 PM, John Dennis jden...@redhat.com wrote:


BTW, why are you parsing diagnostic output?  They are not part of the
official API. We do not have any consistency rules for INFO and DEBUG
messages, they can change at any time and often do. On the other hand
command output is fairly consistent and not subject to the capricious whims
of developers.


Not the original poster, but parsing log events is commonly done prior
to saving them in a structured data store as a transitional measure
while efforts like CEE and Project Lumberjack [1] stabilize.

For example, the popular Logstash project provides a library of
patterns for common services [2]. For users who parse FreeIPA logs,
frequent log formatting changes could be disruptive.

-n

[1] https://fedorahosted.org/lumberjack/
[2] http://logstash.net/docs/1.1.9/filters/grok


That's a good point. What John is talking about though are informative 
messages output by the client tool, not something that would end up in a 
log.


rob

___
Freeipa-users mailing list
Freeipa-users@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-users


Re: [Freeipa-users] What does the u mean in IPA messages?

2013-03-01 Thread KodaK
On Thu, Feb 28, 2013 at 5:01 PM, John Dennis jden...@redhat.com wrote:
 On 02/28/2013 05:34 PM, KodaK wrote:

 BTW, why are you parsing diagnostic output?

I haven't actually started yet, I was just getting my bearings.

I was going to wrap the commands in some scripts so I can do things
like allow an auditor to view the results of an HBAC test without
being able to modify them.  Among other things.  Is there a way to
turn off the diagnostic messages?  They appear to be on by default.

-- 
The government is going to read our mail anyway, might as well make it
tough for them.  GPG Public key ID:  B6A1A7C6

___
Freeipa-users mailing list
Freeipa-users@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-users


Re: [Freeipa-users] What does the u mean in IPA messages?

2013-03-01 Thread John Dennis

On 03/01/2013 03:17 PM, KodaK wrote:

On Thu, Feb 28, 2013 at 5:01 PM, John Dennis jden...@redhat.com wrote:

On 02/28/2013 05:34 PM, KodaK wrote:



BTW, why are you parsing diagnostic output?


I haven't actually started yet, I was just getting my bearings.

I was going to wrap the commands in some scripts so I can do things
like allow an auditor to view the results of an HBAC test without
being able to modify them.  Among other things.  Is there a way to
turn off the diagnostic messages?  They appear to be on by default.



INFO messages are output when the verbose flag is enabled
DEBUG messages are output when the debug flag is enabled

Those flags can either be set in a config file (/etc/ipa/default.conf or 
~/.ipa/default.con) or via a command line argument.


If you haven't passed the verbose flag to the command then it must be 
set in one of the config files.


Petr Viktorin pvikt...@redhat.com recently cleaned up how messages are 
managed in the command line tools (I don't think this has made it out 
into a public release yet). So there may be changes coming you'll want 
to be aware of, perhaps Petr might fill us in on what's different.


I think we had some client tools that forced verbose to be enabled when 
it should have respected a command line option and/or config option. I 
think that's some of what Petr fixed.


--
John Dennis jden...@redhat.com

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/

___
Freeipa-users mailing list
Freeipa-users@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-users


Re: [Freeipa-users] What does the u mean in IPA messages?

2013-03-01 Thread John Dennis

On 03/01/2013 04:01 PM, John Dennis wrote:

On 03/01/2013 03:17 PM, KodaK wrote:

On Thu, Feb 28, 2013 at 5:01 PM, John Dennis jden...@redhat.com wrote:

On 02/28/2013 05:34 PM, KodaK wrote:



BTW, why are you parsing diagnostic output?


I haven't actually started yet, I was just getting my bearings.

I was going to wrap the commands in some scripts so I can do things
like allow an auditor to view the results of an HBAC test without
being able to modify them.  Among other things.  Is there a way to
turn off the diagnostic messages?  They appear to be on by default.



INFO messages are output when the verbose flag is enabled
DEBUG messages are output when the debug flag is enabled

Those flags can either be set in a config file (/etc/ipa/default.conf or
~/.ipa/default.con) or via a command line argument.

If you haven't passed the verbose flag to the command then it must be
set in one of the config files.

Petr Viktorin pvikt...@redhat.com recently cleaned up how messages are
managed in the command line tools (I don't think this has made it out
into a public release yet). So there may be changes coming you'll want
to be aware of, perhaps Petr might fill us in on what's different.

I think we had some client tools that forced verbose to be enabled when
it should have respected a command line option and/or config option. I
think that's some of what Petr fixed.



Here is the design document for the work Petr did, HTH

http://freeipa.org/page/V3/Logging_and_output


--
John Dennis jden...@redhat.com

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/

___
Freeipa-users mailing list
Freeipa-users@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-users


[Freeipa-users] What does the u mean in IPA messages?

2013-02-28 Thread KodaK
When performing an operation with the IPA tools, I get a message every
time similar to this:

ipa: INFO: Forwarding 'hbactest' to server u'https://ipaserver/ipa/xml'

What does it mean?  I've never seen it say anything other than u
(that I've noticed.)  A pointer to documentation is preferred, but
I've been looking and haven't found anything.  (Lots of stuff on the
International Phonetic Alphabet's use of u though.  I think I'm
qualified to edit dictionaries now.)

Thanks!

-- 
The government is going to read our mail anyway, might as well make it
tough for them.  GPG Public key ID:  B6A1A7C6

___
Freeipa-users mailing list
Freeipa-users@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-users


Re: [Freeipa-users] What does the u mean in IPA messages?

2013-02-28 Thread John Dennis

On 02/28/2013 04:18 PM, KodaK wrote:

When performing an operation with the IPA tools, I get a message every
time similar to this:

ipa: INFO: Forwarding 'hbactest' to server u'https://ipaserver/ipa/xml'

What does it mean?  I've never seen it say anything other than u
(that I've noticed.)  A pointer to documentation is preferred, but
I've been looking and haven't found anything.  (Lots of stuff on the
International Phonetic Alphabet's use of u though.  I think I'm
qualified to edit dictionaries now.)


It means unicode, It's a Python'ism. In Python2 there are two different 
string types str and unicode. str's are have 8-bit characters, unicode 
have wide characters (either 16-bit UCS2 or 32-bit UCS4) depending on 
how Python was built (unicode is UCS4 on our builds). Since IPA in 
internationalized we use unicode for all strings.


What the u prefix is telling you is the type of the string. The only 
reason you see it is because in some places we use the repr method to 
output string data and the repr method prefixes unicode with a u 
character. We've been fixing places where repr method is used, not sure 
if this is one of those or not. We were using repr because early on we 
were not consistent with whether we used str's or unicode objects and it 
was handy to know the difference, it's not so much of an issue any more.



--
John Dennis jden...@redhat.com

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/

___
Freeipa-users mailing list
Freeipa-users@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-users


Re: [Freeipa-users] What does the u mean in IPA messages?

2013-02-28 Thread KodaK
On Thu, Feb 28, 2013 at 3:27 PM, John Dennis jden...@redhat.com wrote:
 On 02/28/2013 04:18 PM, KodaK wrote:

 When performing an operation with the IPA tools, I get a message every
 time similar to this:

 ipa: INFO: Forwarding 'hbactest' to server u'https://ipaserver/ipa/xml'

 What does it mean?  I've never seen it say anything other than u
 (that I've noticed.)  A pointer to documentation is preferred, but
 I've been looking and haven't found anything.  (Lots of stuff on the
 International Phonetic Alphabet's use of u though.  I think I'm
 qualified to edit dictionaries now.)


 It means unicode, It's a Python'ism. In Python2 there are two different
 string types str and unicode. str's are have 8-bit characters, unicode have
 wide characters (either 16-bit UCS2 or 32-bit UCS4) depending on how Python
 was built (unicode is UCS4 on our builds). Since IPA in internationalized we
 use unicode for all strings.

 What the u prefix is telling you is the type of the string. The only reason
 you see it is because in some places we use the repr method to output string
 data and the repr method prefixes unicode with a u character. We've been
 fixing places where repr method is used, not sure if this is one of those or
 not. We were using repr because early on we were not consistent with whether
 we used str's or unicode objects and it was handy to know the difference,
 it's not so much of an issue any more.

Ah, thanks for the explanation.  If I build parsing scripts for
things, is the u going to disappear in the future with the
discontinuation of the repr method?  (That's what set this off in the
first place.)

___
Freeipa-users mailing list
Freeipa-users@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-users


Re: [Freeipa-users] What does the u mean in IPA messages?

2013-02-28 Thread John Dennis

On 02/28/2013 05:34 PM, KodaK wrote:

On Thu, Feb 28, 2013 at 3:27 PM, John Dennis jden...@redhat.com wrote:

On 02/28/2013 04:18 PM, KodaK wrote:


When performing an operation with the IPA tools, I get a message every
time similar to this:

ipa: INFO: Forwarding 'hbactest' to server u'https://ipaserver/ipa/xml'

What does it mean?  I've never seen it say anything other than u
(that I've noticed.)  A pointer to documentation is preferred, but
I've been looking and haven't found anything.  (Lots of stuff on the
International Phonetic Alphabet's use of u though.  I think I'm
qualified to edit dictionaries now.)



It means unicode, It's a Python'ism. In Python2 there are two different
string types str and unicode. str's are have 8-bit characters, unicode have
wide characters (either 16-bit UCS2 or 32-bit UCS4) depending on how Python
was built (unicode is UCS4 on our builds). Since IPA in internationalized we
use unicode for all strings.

What the u prefix is telling you is the type of the string. The only reason
you see it is because in some places we use the repr method to output string
data and the repr method prefixes unicode with a u character. We've been
fixing places where repr method is used, not sure if this is one of those or
not. We were using repr because early on we were not consistent with whether
we used str's or unicode objects and it was handy to know the difference,
it's not so much of an issue any more.


Ah, thanks for the explanation.  If I build parsing scripts for
things, is the u going to disappear in the future with the
discontinuation of the repr method?  (That's what set this off in the
first place.)


You should not depend on the type prefix. There are other prefixes 
besides u but I think u is the only one you'll see in practice. My 
suggestion for parsing would be to permit the prefix but to ignore it if 
it's present.


BTW, why are you parsing diagnostic output?  They are not part of the 
official API. We do not have any consistency rules for INFO and DEBUG 
messages, they can change at any time and often do. On the other hand 
command output is fairly consistent and not subject to the capricious 
whims of developers.




--
John Dennis jden...@redhat.com

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/

___
Freeipa-users mailing list
Freeipa-users@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-users


Re: [Freeipa-users] What does the u mean in IPA messages?

2013-02-28 Thread Martin Kosek
On 02/28/2013 11:34 PM, KodaK wrote:
 On Thu, Feb 28, 2013 at 3:27 PM, John Dennis jden...@redhat.com wrote:
 On 02/28/2013 04:18 PM, KodaK wrote:

 When performing an operation with the IPA tools, I get a message every
 time similar to this:

 ipa: INFO: Forwarding 'hbactest' to server u'https://ipaserver/ipa/xml'

 What does it mean?  I've never seen it say anything other than u
 (that I've noticed.)  A pointer to documentation is preferred, but
 I've been looking and haven't found anything.  (Lots of stuff on the
 International Phonetic Alphabet's use of u though.  I think I'm
 qualified to edit dictionaries now.)


 It means unicode, It's a Python'ism. In Python2 there are two different
 string types str and unicode. str's are have 8-bit characters, unicode have
 wide characters (either 16-bit UCS2 or 32-bit UCS4) depending on how Python
 was built (unicode is UCS4 on our builds). Since IPA in internationalized we
 use unicode for all strings.

 What the u prefix is telling you is the type of the string. The only reason
 you see it is because in some places we use the repr method to output string
 data and the repr method prefixes unicode with a u character. We've been
 fixing places where repr method is used, not sure if this is one of those or
 not. We were using repr because early on we were not consistent with whether
 we used str's or unicode objects and it was handy to know the difference,
 it's not so much of an issue any more.
 
 Ah, thanks for the explanation.  If I build parsing scripts for
 things, is the u going to disappear in the future with the
 discontinuation of the repr method?  (That's what set this off in the
 first place.)

To answer your question - yes, these are going to disappear. A code fixing
these strings was already pushed to our upstream git repository. You can check
the relevant ticket here:

https://fedorahosted.org/freeipa/ticket/3121

Maritn

___
Freeipa-users mailing list
Freeipa-users@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-users