add --hostname option to certmaster-request to allow specifying the CN for the cert
[certmaster.git] / scripts / certmaster-request
1 #!/usr/bin/python
2
3 """
4 Application to request a cert from a certmaster.
5 Takes no arguments, uses /etc/certmaster/minion.conf
6
7 Copyright 2008, Red Hat, Inc
8 Michael DeHaan <mdehaan@redhat.com>
9
10 This software may be freely redistributed under the terms of the GNU
11 general public license.
12
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.
16 """
17
18 import distutils.sysconfig
19 import optparse
20
21 from certmaster import requester
22
23 if __name__ == "__main__":
24 parser = optparse.OptionParser()
25
26 parser.add_option('--hostname', action="store", dest="hostname",
27 metavar="NAME",
28 help='hostname to use as the CN for the certificate')
29
30 (opts, args) = parser.parse_args()
31
32 requester.request_cert(hostname=opts.hostname)