diff options
Diffstat (limited to 'ipaclient/plugins/certprofile.py')
-rw-r--r-- | ipaclient/plugins/certprofile.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ipaclient/plugins/certprofile.py b/ipaclient/plugins/certprofile.py new file mode 100644 index 000000000..4fe1026d0 --- /dev/null +++ b/ipaclient/plugins/certprofile.py @@ -0,0 +1,28 @@ +# +# Copyright (C) 2015 FreeIPA Contributors see COPYING for license +# + +from ipaclient.frontend import MethodOverride +from ipalib import util +from ipalib.plugable import Registry +from ipalib.text import _ + +register = Registry() + + +@register(override=True) +class certprofile_show(MethodOverride): + def forward(self, *keys, **options): + if 'out' in options: + util.check_writable_file(options['out']) + + result = super(certprofile_show, self).forward(*keys, **options) + if 'out' in options and 'config' in result['result']: + with open(options['out'], 'wb') as f: + f.write(result['result'].pop('config')) + result['summary'] = ( + _("Profile configuration stored in file '%(file)s'") + % dict(file=options['out']) + ) + + return result |