Description of problem: Unable to create a repo with unicode characters. Steps to Reproduce: 1. pulp-admin repo create --arch=x86_64 --feed yum:http://download.fedora.redhat.com/pub/fedora/linux/updates/13/x86_64/ --name="Příliš žluťoučký kůŇ úpěl Ďábelské ódy" --id=fedora-repo-with-czech-name 2. error occurs 3. nothing in the audit.log I am going to provide a patch to solve this problem.
The problem is in the src/pulp/server/auditing.py method audit_repr(value). It tries to decode both strings and unicode objects. Unicode objects in Python are not subjects of decoding. I think the intention for this method was to "Return an audit-friendly representation of a value." and to encode unicode strings to simple ASCII representation. For example to log string Příliš žluťoučký kůŇ úpěl Ďábelské ódy as P??li? ?lu?ou?k? k?? ?p?l ??belsk? ?dy in the events.log. For this case I have prepared a patch that fixes the audit_repr method. It decodes only string objects and encodes them to ASCII properly. Unicode objects are only encoded to ASCII since they are already "decoded". Attaching. The question is if this is correct approach because for Chineese or Japanese the unicode messages could be quite useless (like "???" or "??????????"). Therefore maybe the pulp authors would like to prefer to output strings "as is". In this case modification needs to be done since currently the Pulp server is trying to decode already decoded strings. I can provide the patch for this outputting as well.
Created attachment 474938 [details] Solution A patch
Preethi - forgot to set MODIFIED flag. This has been commited and pushed weeks ago. Should work now.
Build: 0.145
verified [root@preethi ~]# rpm -q pulp pulp-0.0.146-1.fc14.noarch [root@preethi ~]# pulp-admin repo create --arch=x86_64 --feed yum:http://download.fedora.redhat.com/pub/fedora/linux/updates/13/x86_64/ --name="Příliš žluťoučký kůŇ úpěl Ďábelské ódy" --id=fedora-repo-with-czech-name Successfully created repository [ fedora-repo-with-czech-name ] [root@preethi ~]# pulp-admin -u admin -p admin repo list+------------------------------------------+ List of Available Repositories +------------------------------------------+ Id fedora-repo-with-czech-name Name Příliš žluťoučký kůŇ úpěl Ďábelské ódy FeedURL http://download.fedora.redhat.com/pub/fedora/linux/updates/13/x86_64/ FeedType yum Arch x86_64 Sync Schedule None Packages 0 Files 0 Distributions None Publish True Clones [] Groups None Filters []
Closing with current community release pulp-0.0.223