summaryrefslogtreecommitdiffstats
path: root/base/server
diff options
context:
space:
mode:
authorChristian Heimes <cheimes@redhat.com>2015-07-01 13:15:30 +0200
committerChristian Heimes <cheimes@redhat.com>2015-07-10 10:35:54 +0200
commit597bf54f3e999867a3e42686b3063b169b52018c (patch)
tree30556ee484a2ff3eb931c92d0f0fad130f35aa72 /base/server
parentfa302897b3e97d78b925e8ee763c822a1169f07a (diff)
downloadpki-597bf54f3e999867a3e42686b3063b169b52018c.tar.gz
pki-597bf54f3e999867a3e42686b3063b169b52018c.tar.xz
pki-597bf54f3e999867a3e42686b3063b169b52018c.zip
In-tree tests and linting with tox
Before the patch it wasn't possible to run pylint outside a RPM build. The Python sources were split into common and server files in two separate trees. With setup.py and tox the pki package can now be installed and tested in a virtual env. Tox enables developers to automate installation and testing in Python virtual environment. The new tox.ini performs several tasks with one command: * It creates and installs a source distribution of pki packages and its command line scripts * It verifies that all CLI scripts can be execute (using its --help argument). * It runs pylint on all Python files and CLI scripts. * It can run flake8 on all Python and CLI files (disabled for now). * Finally it builds Sphinx autodocs. I had to delay the root check in pkispawn and pkidestroy and modify two files to get rid of Sphinx warnings. https://fedorahosted.org/pki/ticket/696 http://tox.readthedocs.org
Diffstat (limited to 'base/server')
-rwxr-xr-xbase/server/sbin/pkidestroy8
-rwxr-xr-xbase/server/sbin/pkispawn8
2 files changed, 8 insertions, 8 deletions
diff --git a/base/server/sbin/pkidestroy b/base/server/sbin/pkidestroy
index c2eb91a5a..abc11dc8d 100755
--- a/base/server/sbin/pkidestroy
+++ b/base/server/sbin/pkidestroy
@@ -63,10 +63,6 @@ def main(argv):
config.pki_deployment_executable = os.path.basename(argv[0])
- # Only run this program as "root".
- if not os.geteuid() == 0:
- sys.exit("'%s' must be run as root!" % argv[0])
-
# Set the umask
os.umask(config.PKI_DEPLOYMENT_DEFAULT_UMASK)
@@ -130,6 +126,10 @@ def main(argv):
interactive = False
+ # Only run this program as "root".
+ if not os.geteuid() == 0:
+ sys.exit("'%s' must be run as root!" % argv[0])
+
while True:
# -s <subsystem>
diff --git a/base/server/sbin/pkispawn b/base/server/sbin/pkispawn
index bebbf0b77..fb5a61a8f 100755
--- a/base/server/sbin/pkispawn
+++ b/base/server/sbin/pkispawn
@@ -66,10 +66,6 @@ def main(argv):
config.pki_deployment_executable = os.path.basename(argv[0])
- # Only run this program as "root".
- if not os.geteuid() == 0:
- sys.exit("'%s' must be run as root!" % argv[0])
-
# Set the umask
os.umask(config.PKI_DEPLOYMENT_DEFAULT_UMASK)
@@ -130,6 +126,10 @@ def main(argv):
parser.indent = 0
print log.PKISPAWN_INTERACTIVE_INSTALLATION
+ # Only run this program as "root".
+ if not os.geteuid() == 0:
+ sys.exit("'%s' must be run as root!" % argv[0])
+
while True:
# -s <subsystem>
if args.pki_subsystem is None: