[Freeipa-devel] [PATCH 017] certprofile-import: do not require profileId in profile data

Christian Heimes cheimes at redhat.com
Fri Jul 24 09:31:15 UTC 2015


On 2015-07-24 05:15, Fraser Tweedale wrote:
>> diff --git a/ipalib/plugins/certprofile.py b/ipalib/plugins/certprofile.py
>> index 5550ed942521dbab2e783fba1570520268f9b378..fe8934690fe09499f0bacb6610d9815a2b4367a4 100644
>> --- a/ipalib/plugins/certprofile.py
>> +++ b/ipalib/plugins/certprofile.py
>> @@ -233,8 +233,8 @@ class certprofile_import(LDAPCreate):
>>  
>>          match = self.PROFILE_ID_PATTERN.search(options['file'])
>>          if match is None:
>> -            raise errors.ValidationError(name='file',
>> -                error=_("Profile ID is not present in profile data"))
>> +            # no profileId found, use CLI value as profileId.
>> +            options['file'] = u'profileId=%s\n%s' % (keys[0], options['file'])
> 
> NACK
> 
> This assignment has no external effect; `post_callback' is called
> with original `options['file']' and dogtag profile import can fail
> due to missing profileId.
> 
> The solution is to do the same thing in post_callback; updated patch
> attached.

Oh, I should have noticed that myself. The options parameter is passed
in as **kwargs. The keyword arguments dict is always a flat copy.

Thanks!
Christian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20150724/84028ffc/attachment.sig>


More information about the Freeipa-devel mailing list