Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cert: include CA name in cert command output #20

Closed
wants to merge 1 commit into from
Closed

cert: include CA name in cert command output #20

wants to merge 1 commit into from

Conversation

HonzaCholasta
Copy link
Contributor

@HonzaCholasta HonzaCholasta commented Aug 25, 2016

Include name of the CA that issued a certificate in cert-request, cert-show
and cert-find.

This allows the caller to call further commands on the cert without having
to call ca-find to find the name of the CA.

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

@MartinBasti
Copy link
Contributor

NACK

[Thu Aug 25 13:31:13.597892 2016] [wsgi:error] [pid 130658] ipa: ERROR: non-public: KeyError: 'cacn'
[Thu Aug 25 13:31:13.597940 2016] [wsgi:error] [pid 130658] Traceback (most recent call last):
[Thu Aug 25 13:31:13.597945 2016] [wsgi:error] [pid 130658]   File "/usr/lib/python2.7/site-packages/ipaserver/rpcserver.py", line 352, in wsgi_execute
[Thu Aug 25 13:31:13.597949 2016] [wsgi:error] [pid 130658]     result = self.Command[name](*args, **options)
[Thu Aug 25 13:31:13.597952 2016] [wsgi:error] [pid 130658]   File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 449, in __call__
[Thu Aug 25 13:31:13.597955 2016] [wsgi:error] [pid 130658]     return self.__do_call(*args, **options)
[Thu Aug 25 13:31:13.597959 2016] [wsgi:error] [pid 130658]   File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 477, in __do_call
[Thu Aug 25 13:31:13.597967 2016] [wsgi:error] [pid 130658]     ret = self.run(*args, **options)
[Thu Aug 25 13:31:13.597971 2016] [wsgi:error] [pid 130658]   File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 799, in run
[Thu Aug 25 13:31:13.597974 2016] [wsgi:error] [pid 130658]     return self.execute(*args, **options)
[Thu Aug 25 13:31:13.597978 2016] [wsgi:error] [pid 130658]   File "/usr/lib/python2.7/site-packages/ipaserver/plugins/cert.py", line 629, in execute
[Thu Aug 25 13:31:13.597981 2016] [wsgi:error] [pid 130658]     result['cacn'] = ca_obj['cacn'][0]
[Thu Aug 25 13:31:13.597984 2016] [wsgi:error] [pid 130658] KeyError: 'cacn'

Please update tests too.

@@ -623,6 +626,7 @@ def execute(self, csr, all=False, raw=False, **kw):
if not raw:
self.obj._parse(result)
result['request_id'] = int(result['request_id'])
result['cacn'] = ca_obj['cacn'][0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be ca_obj['cn'][0], but we already have the cn in variable ca
anyway - there is no need to get it from the ca_obj.

@MartinBasti
Copy link
Contributor

test_xmlrpc/test_cert_plugin.py ........F.........................F....

2 same internal errors:

[Mon Aug 29 14:57:07.951307 2016] [wsgi:error] [pid 66778] ipa: ERROR: non-public: KeyError: ipapython.dn.DN('CN=SMIME CA,O=test industries Inc.')
[Mon Aug 29 14:57:07.951339 2016] [wsgi:error] [pid 66778] Traceback (most recent call last):
[Mon Aug 29 14:57:07.951342 2016] [wsgi:error] [pid 66778]   File "/usr/lib/python2.7/site-packages/ipaserver/rpcserver.py", line 352, in wsgi_execute
[Mon Aug 29 14:57:07.951345 2016] [wsgi:error] [pid 66778]     result = self.Command[name](*args, **options)
[Mon Aug 29 14:57:07.951348 2016] [wsgi:error] [pid 66778]   File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 449, in __call__
[Mon Aug 29 14:57:07.951351 2016] [wsgi:error] [pid 66778]     return self.__do_call(*args, **options)
[Mon Aug 29 14:57:07.951353 2016] [wsgi:error] [pid 66778]   File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 477, in __do_call
[Mon Aug 29 14:57:07.951356 2016] [wsgi:error] [pid 66778]     ret = self.run(*args, **options)
[Mon Aug 29 14:57:07.951380 2016] [wsgi:error] [pid 66778]   File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 799, in run
[Mon Aug 29 14:57:07.951383 2016] [wsgi:error] [pid 66778]     return self.execute(*args, **options)
[Mon Aug 29 14:57:07.951385 2016] [wsgi:error] [pid 66778]   File "/usr/lib/python2.7/site-packages/ipaserver/plugins/cert.py", line 1347, in execute
[Mon Aug 29 14:57:07.951388 2016] [wsgi:error] [pid 66778]     **options)
[Mon Aug 29 14:57:07.951391 2016] [wsgi:error] [pid 66778]   File "/usr/lib/python2.7/site-packages/ipaserver/plugins/cert.py", line 1227, in _ca_search
[Mon Aug 29 14:57:07.951406 2016] [wsgi:error] [pid 66778]     obj['cacn'] = cas[issuer]['cn'][0]
[Mon Aug 29 14:57:07.951410 2016] [wsgi:error] [pid 66778] KeyError: ipapython.dn.DN('CN=SMIME CA,O=test industries Inc.')

@MartinBasti MartinBasti added the ack Pull Request approved, can be merged label Aug 30, 2016
Include name of the CA that issued a certificate in cert-request, cert-show
and cert-find.

This allows the caller to call further commands on the cert without having
to call ca-find to find the name of the CA.

https://fedorahosted.org/freeipa/ticket/6151
@MartinBasti
Copy link
Contributor

@MartinBasti MartinBasti added the pushed Pull Request has already been pushed label Aug 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged pushed Pull Request has already been pushed
Projects
None yet
3 participants