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
22 from certmaster
import requester
24 if __name__
== "__main__":
25 parser
= optparse
.OptionParser()
27 parser
.add_option('--hostname', action
="store", dest
="hostname",
29 help='hostname to use as the CN for the certificate')
31 parser
.add_option('--ca', action
="store", dest
="ca", default
='',
33 help='certificate authority used to sign the certificate')
35 (opts
, args
) = parser
.parse_args()
38 requester
.request_cert(hostname
=opts
.hostname
, ca_name
=opts
.ca
)
39 except Exception as e
:
40 print >> sys
.stderr
, "error: %s" % str(e
)