diff options
author | Adrian Likins <alikins@redhat.com> | 2008-02-05 15:29:44 -0500 |
---|---|---|
committer | Adrian Likins <alikins@redhat.com> | 2008-02-05 15:29:44 -0500 |
commit | d66c63d5bff25a1296e7a98301bef462c16d2a0c (patch) | |
tree | abde3cab98b7ab1da1aa2a526fab2e65d981f40a /func/minion/modules/certmaster.py | |
parent | e9875ad4ccaa017e91e0528ec2753f1098218e79 (diff) | |
parent | 8c7114e9c59419fb1ecce075e56c34e0198b8228 (diff) | |
download | third_party-func-d66c63d5bff25a1296e7a98301bef462c16d2a0c.tar.gz third_party-func-d66c63d5bff25a1296e7a98301bef462c16d2a0c.tar.xz third_party-func-d66c63d5bff25a1296e7a98301bef462c16d2a0c.zip |
Merge branch 'master' of ssh://alikins@git.fedorahosted.org/git/func
Diffstat (limited to 'func/minion/modules/certmaster.py')
-rw-r--r-- | func/minion/modules/certmaster.py | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/func/minion/modules/certmaster.py b/func/minion/modules/certmaster.py new file mode 100644 index 0000000..9ca484f --- /dev/null +++ b/func/minion/modules/certmaster.py @@ -0,0 +1,65 @@ +## -*- coding: utf-8 -*- +## +## Process lister (control TBA) +## +## Copyright 2008, Red Hat, Inc +## Michael DeHaan <mdehaan@redhat.com> +## +## This software may be freely redistributed under the terms of the GNU +## general public license. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +## + +# other modules +import sub_process +import codes + +# our modules +import func_module +from func import certmaster as certmaster + +# ================================= + +class CertMasterModule(func_module.FuncModule): + + version = "0.0.1" + api_version = "0.0.1" + description = "Administers certs on an overlord." + + def get_hosts_to_sign(self, list_of_hosts): + """ + ... + """ + list_of_hosts = self.__listify(list_of_hosts) + cm = certmaster.CertMaster() + return cm.get_csrs_waiting() + + def sign_hosts(self, list_of_hosts): + """ + ... + """ + list_of_hosts = self.__listify(list_of_hosts) + cm = certmaster.CertMaster() + for x in list_of_hosts: + cm.sign_this_csr(x) + return True + + def cleanup_hosts(self, list_of_hosts): + """ + ... + """ + list_of_hosts = self.__listify(list_of_hosts) + cm = certmaster.CertMaster() + for x in list_of_hosts: + cm.remove_this_cert(x) + return True + + def __listify(self, list_of_hosts): + if type(list_of_hosts) is type([]): + return list_of_hosts + else: + return [ list_of_hosts ] + |