4 Application to request a cert from a certmaster.
5 Takes no arguments, uses /etc/certmaster/minion.conf
7 Copyright 2008, Red Hat, Inc
8 Michael DeHaan <mdehaan@redhat.com>
10 This software may be freely redistributed under the terms of the GNU
11 general public license.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 import distutils
.sysconfig
23 from certmaster
import requester
25 if __name__
== "__main__":
26 parser
= optparse
.OptionParser()
28 parser
.add_option('--hostname', action
="store", dest
="hostname",
30 help='hostname to use as the CN for the certificate')
32 parser
.add_option('--ca', action
="store", dest
="ca", default
='',
34 help='certificate authority used to sign the certificate')
36 (opts
, args
) = parser
.parse_args()
39 requester
.request_cert(hostname
=opts
.hostname
, ca_name
=opts
.ca
)
40 except xmlrpclib
.Fault
as f
:
41 print >> sys
.stderr
, "error: %s" % str(f
.faultString
)
42 except Exception as e
:
43 print >> sys
.stderr
, "error: %s" % str(e
)