summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Likins <alikins@redhat.com>2007-09-25 16:18:24 -0400
committerAdrian Likins <alikins@redhat.com>2007-09-25 16:18:24 -0400
commit5f6c1e6fbad9ca39d795a81e64f571aa661f3c94 (patch)
tree4632c44c87c9db4532e82413d519bfdaab37695d
parent35d0caf698d3668f6411587796b1ab22af17179c (diff)
parentef8aad0268ae9dc9efebd96714ca23e5a5369b49 (diff)
downloadthird_party-func-5f6c1e6fbad9ca39d795a81e64f571aa661f3c94.tar.gz
third_party-func-5f6c1e6fbad9ca39d795a81e64f571aa661f3c94.tar.xz
third_party-func-5f6c1e6fbad9ca39d795a81e64f571aa661f3c94.zip
Merge branch 'master' of ssh://git.fedoraproject.org/git/hosted/func
-rw-r--r--func.spec1
-rwxr-xr-xfunc/certmaster.py18
-rwxr-xr-xscripts/certmaster7
-rwxr-xr-xscripts/func14
-rw-r--r--setup.py2
5 files changed, 31 insertions, 11 deletions
diff --git a/func.spec b/func.spec
index c516fb9..30c6ab8 100644
--- a/func.spec
+++ b/func.spec
@@ -35,6 +35,7 @@ rm -fr $RPM_BUILD_ROOT
%files
%{_bindir}/funcd
+%{_bindir}/func
%{_bindir}/certmaster
/etc/init.d/funcd
/etc/init.d/certmaster
diff --git a/func/certmaster.py b/func/certmaster.py
index 59bfd36..b12ecdb 100755
--- a/func/certmaster.py
+++ b/func/certmaster.py
@@ -61,12 +61,22 @@ class CertMaster(object):
else:
self.cfg.autosign = False
self.cfg.listen_port = int(self.cfg.listen_port)
+ self.ca_key_file = '%s/funcmaster.key' % self.cfg.cadir
+ self.ca_cert_file = '%s/funcmaster.crt' % self.cfg.cadir
+ try:
+ if not os.path.exists(self.cfg.cadir):
+ os.makedirs(self.cfg.cadir)
+ # fixme - should we creating these separately?
+ if not os.path.exists(self.ca_key_file) and not os.path.exists(self.ca_cert_file):
+ func.certs.create_ca(ca_key_file=self.ca_key_file, ca_cert_file=self.ca_cert_file)
+ except (IOError, OsError), e:
+ print 'Cannot make certmaster certificate authority keys/certs, aborting: %s' % e
+ sys.exit(1)
+
# open up the cakey and cacert so we have them available
- ca_key_file = '%s/funcmaster.key' % self.cfg.cadir
- ca_cert_file = '%s/funcmaster.crt' % self.cfg.cadir
- self.cakey = func.certs.retrieve_key_from_file(ca_key_file)
- self.cacert = func.certs.retrieve_cert_from_file(ca_cert_file)
+ self.cakey = func.certs.retrieve_key_from_file(self.ca_key_file)
+ self.cacert = func.certs.retrieve_cert_from_file(self.ca_cert_file)
for dirpath in [self.cfg.cadir, self.cfg.certroot, self.cfg.csrroot]:
if not os.path.exists(dirpath):
diff --git a/scripts/certmaster b/scripts/certmaster
index 1be4c58..f4bcf53 100755
--- a/scripts/certmaster
+++ b/scripts/certmaster
@@ -1,11 +1,6 @@
#!/usr/bin/python
-import sys
-import distutils.sysconfig
-
-sys.path.append("%s/func" % distutils.sysconfig.get_python_lib())
-
-import certmaster
+from func import certmaster
defaults = { 'listen_addr': 'localhost',
'listen_port': '51235',
diff --git a/scripts/func b/scripts/func
new file mode 100755
index 0000000..2afb4e7
--- /dev/null
+++ b/scripts/func
@@ -0,0 +1,14 @@
+#!/usr/bin/python
+
+import sys
+import distutils.sysconfig
+
+# sys.path.append("%s/func" % distutils.sysconfig.get_python_lib())
+
+import func.overlord.client as client
+
+myname, argv = sys.argv[0], sys.argv[1:]
+cli = client.FuncCommandLine(myname, argv)
+cli.run()
+
+
diff --git a/setup.py b/setup.py
index 156b824..8fcd0ca 100644
--- a/setup.py
+++ b/setup.py
@@ -39,7 +39,7 @@ if __name__ == "__main__":
author_email = "func-list@redhat.com",
url = "https://hosted.fedoraproject.org/projects/func/",
license = "GPL",
- scripts = ["scripts/funcd", "scripts/certmaster"],
+ scripts = ["scripts/funcd", "scripts/func", "scripts/certmaster"],
# package_data = { '' : ['*.*'] },
package_dir = {"%s" % NAME: "%s" % NAME,
"%s/minion" % NAME: "minion/",