summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-09-28 15:37:55 -0400
committerMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-09-28 15:37:55 -0400
commitfe2993777f86b479bec4e2daf7eef91813537f6d (patch)
tree2f993b7ae9eca2e0e2d1b65b3fef77f2bdc27156
parent114dd90baf8d300e7ba6f058fe42a0d2ebdbd223 (diff)
parent99a55551d25a81bf019a90193f084eba386f2512 (diff)
downloadfunc-fe2993777f86b479bec4e2daf7eef91813537f6d.tar.gz
func-fe2993777f86b479bec4e2daf7eef91813537f6d.tar.xz
func-fe2993777f86b479bec4e2daf7eef91813537f6d.zip
Merge branch 'master' of ssh://git.fedoraproject.org/git/hosted/funcv0.0.12
-rwxr-xr-xMakefile36
-rw-r--r--func.spec4
-rwxr-xr-xfunc/certmaster.py4
-rwxr-xr-xfunc/logger.py6
-rwxr-xr-xminion/module_loader.py3
-rwxr-xr-xminion/server.py5
6 files changed, 33 insertions, 25 deletions
diff --git a/Makefile b/Makefile
index 5c467fd..8ef2d33 100755
--- a/Makefile
+++ b/Makefile
@@ -12,23 +12,6 @@ INITDIR = init-scripts
all: rpms
-clean:
- -rm -f MANIFEST
- -rm -rf dist/ build/
- -rm -rf *~
- -rm -rf rpm-build/
- -rm -rf docs/*.gz
- -for d in $(DIRS); do ($(MAKE) -C $$d clean ); done
-
-clean_hard:
- -rm -rf $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")/func
-
-clean_harder:
- -rm -rf /etc/pki/func
- -rm -rf /etc/func
- -rm -rf /var/lib/func
-
-clean_hardest: clean_rpms
manpage:
pod2man --center="funcd" --release="" ./docs/funcd.pod | gzip -c > ./docs/funcd.1.gz
@@ -50,6 +33,25 @@ setversion:
build: clean
python setup.py build -f
+clean:
+ -rm -f MANIFEST
+ -rm -rf dist/ build/
+ -rm -rf *~
+ -rm -rf rpm-build/
+ -rm -rf docs/*.gz
+ -for d in $(DIRS); do ($(MAKE) -C $$d clean ); done
+
+clean_hard:
+ -rm -rf $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")/func
+
+clean_harder:
+ -rm -rf /etc/pki/func
+ -rm -rf /etc/func
+ -rm -rf /var/lib/func
+
+clean_hardest: clean_rpms
+
+
install: build manpage
python setup.py install -f
diff --git a/func.spec b/func.spec
index b0547b9..5586963 100644
--- a/func.spec
+++ b/func.spec
@@ -10,7 +10,6 @@ Source0: %{name}-%{version}.tar.gz
License: GPL+
Group: Applications/System
Requires: python >= 2.3
-Requires: rhpl
Requires: pyOpenSSL
BuildRequires: python-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
@@ -74,6 +73,9 @@ fi
%changelog
+* Fri Sep 28 2007 Adrian Likins <alikins@redhat.com> - 0.0.12-1
+- remove rhpl deps
+
* Fri Sep 28 2007 Michael DeHaan <mdehaan@redhat.com> - 0.0.12-1
- bump version and get ready for first public release
- add BuildRequires python-devel
diff --git a/func/certmaster.py b/func/certmaster.py
index 0c1f333..bcff926 100755
--- a/func/certmaster.py
+++ b/func/certmaster.py
@@ -24,6 +24,7 @@ import os.path
from OpenSSL import crypto
import sha
import glob
+import socket
#from func.server import codes
import certs
@@ -35,13 +36,14 @@ from commonconfig import CMConfig
class CertMaster(object):
def __init__(self, conf_file):
self.cfg = read_config(conf_file, CMConfig)
+ mycn = '%s-CA-KEY' % socket.getfqdn()
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)
if not os.path.exists(self.ca_key_file) and not os.path.exists(self.ca_cert_file):
- certs.create_ca(ca_key_file=self.ca_key_file, ca_cert_file=self.ca_cert_file)
+ certs.create_ca(CN=mycn, 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)
diff --git a/func/logger.py b/func/logger.py
index 681576e..cdfa899 100755
--- a/func/logger.py
+++ b/func/logger.py
@@ -61,9 +61,9 @@ class AuditLogger(Singleton):
if self._no_handlers:
self._setup_handlers(logfilepath=logfilepath)
- def log_call(self, CN, cert_hash, method, params):
+ def log_call(self, ip, CN, cert_hash, method, params):
# square away a good parseable format at some point -akl
- self.logger.info("%s %s %s called with %s" % (CN, cert_hash, method, params))
+ self.logger.info("%s %s %s %s called with %s" % (ip, CN, cert_hash, method, params))
def _setup_logging(self):
@@ -72,7 +72,7 @@ class AuditLogger(Singleton):
def _setup_handlers(self, logfilepath="/var/log/func/audit.log"):
handler = logging.FileHandler(logfilepath, "a")
self.logger.setLevel(self.loglevel)
- formatter = logging.Formatter("%(asctime)s - %(levelname)s - %(message)s")
+ formatter = logging.Formatter("%(asctime)s - %(message)s")
handler.setFormatter(formatter)
self.logger.addHandler(handler)
self._no_handlers = False
diff --git a/minion/module_loader.py b/minion/module_loader.py
index eef7433..4538fb2 100755
--- a/minion/module_loader.py
+++ b/minion/module_loader.py
@@ -18,7 +18,8 @@
import distutils.sysconfig
import os
import sys
-from rhpl.translate import _
+from gettext import gettext
+_ = gettext
def module_walker(topdir):
diff --git a/minion/server.py b/minion/server.py
index fcfe537..5671836 100755
--- a/minion/server.py
+++ b/minion/server.py
@@ -21,7 +21,7 @@ import sys
import traceback
import socket
-from rhpl.translate import textdomain
+from gettext import textdomain
I18N_DOMAIN = "func"
@@ -192,6 +192,7 @@ class FuncSSLXMLRPCServer(AuthedXMLRPCServer.AuthedSSLXMLRPCServer,
if hasattr(self, '_this_request'):
r,a = self._this_request
p = r.get_peer_certificate()
+ ip = a[0]
cn = p.get_subject().CN
sub_hash = p.subject_name_hash()
else:
@@ -199,7 +200,7 @@ class FuncSSLXMLRPCServer(AuthedXMLRPCServer.AuthedSSLXMLRPCServer,
# XXX FIXME - need to figure out how to dig into the server base classes
# so we can get client ip, and eventually cert id info -akl
- self.audit_logger.log_call(cn, sub_hash, method, params)
+ self.audit_logger.log_call(ip, cn, sub_hash, method, params)
return self.get_dispatch_method(method)(*params)