[Pacemaker] CRM: 'ascii' codec can't encode character

Nikita Michalko michalko.system at a-i-p.com
Wed May 25 08:59:12 UTC 2011


Hi Lars,

thank you very match - indeed that was it! After changing the value of 
"timeout" to 60, the crm shell work again.
I changed also utf8 coding to locale - much better ...


Best wishes

Nikita Michalko


Am Mittwoch 25 Mai 2011 10:09:49 schrieb Lars Ellenberg:
> On Wed, May 25, 2011 at 09:12:29AM +0200, Nikita Michalko wrote:
> > Hi Dejan,
> >
> >
> > thanks for your reply! Here is the output of the command :
> > /usr/lib64/heartbeat/crmd version
> > CRM Version: 1.1.5 (ecb6baaf7fc091b023d6d4ba7e0fce26d32cf5c8)
> > And cib.xml is attached ...
> 
> There:
> >         <nvpair id="op_defaults-options-timeout" name="timeout"
> > value="6&#xDF;"/>
> 
> You got an "6ß" there (or at least that's what it looks like when
> converted to utf8...)
> 
> Change that to 6s (or whatever you actually meant),
> and the crm shell will work again.
> 
> Below patchlet makes the crm shell not crash on this for me.
> But I'm not sure if hardcoding "utf8" is the best way forward,
> probably it should be locale aware.
> Possibly it needs to put a try execpt around that s.encode,
> and chose a different representation, if it is not possible
> to encode it in whatever the current locale is?
> 
> 
> diff --git a/shell/modules/parse.py b/shell/modules/parse.py
> --- a/shell/modules/parse.py
> +++ b/shell/modules/parse.py
> @@ -728,7 +728,7 @@ class CliParser(object):
>          '''
>          cli_list = ''
>          if type(s) == type(u''):
> -            s = s.encode('ascii')
> +            s = s.encode('utf8')
>          if type(s) == type(''):
>              if s and s.startswith('#'):
>                  self.comments.append(s)
> 




More information about the Pacemaker mailing list