1 ## -*- coding: utf-8 -*-
3 ## Process lister (control TBA)
5 ## Copyright 2008, Red Hat, Inc
6 ## Michael DeHaan <mdehaan@redhat.com>
8 ## This software may be freely redistributed under the terms of the GNU
9 ## general public license.
11 ## You should have received a copy of the GNU General Public License
12 ## along with this program; if not, write to the Free Software
13 ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 from func
import certmaster
as certmaster
24 # =================================
26 class CertMasterModule(func_module
.FuncModule
):
30 description
= "Administers certs on an overlord."
32 def get_hosts_to_sign(self
, list_of_hosts
):
36 list_of_hosts
= self
.__listify
(list_of_hosts
)
37 cm
= certmaster
.CertMaster()
38 return cm
.get_csrs_waiting()
40 def sign_hosts(self
, list_of_hosts
):
44 list_of_hosts
= self
.__listify
(list_of_hosts
)
45 cm
= certmaster
.CertMaster()
46 for x
in list_of_hosts
:
50 def cleanup_hosts(self
, list_of_hosts
):
54 list_of_hosts
= self
.__listify
(list_of_hosts
)
55 cm
= certmaster
.CertMaster()
56 for x
in list_of_hosts
:
57 cm
.remove_this_cert(x
)
60 def __listify(self
, list_of_hosts
):
61 if type(list_of_hosts
) is type([]):
64 return [ list_of_hosts
]