summaryrefslogtreecommitdiff
path: root/scripts/docker/files/bin/setup-test-env.py
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2016-11-10 23:50:35 -0200
committerdrebs <drebs@leap.se>2016-11-10 23:50:35 -0200
commit564f55802455d08c9a38e892bb4b25ad6fbcb87d (patch)
treeb214482c46ecd09d531a3bc7bf254bf47d367fb5 /scripts/docker/files/bin/setup-test-env.py
parentc1950b41e0995b0213227bd0ce2c633f312037dc (diff)
parent0fd7e9f018b02161a844c11332ffced56b256010 (diff)
Merge tag '0.9.0'
Tag version 0.9.0
Diffstat (limited to 'scripts/docker/files/bin/setup-test-env.py')
-rwxr-xr-xscripts/docker/files/bin/setup-test-env.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/scripts/docker/files/bin/setup-test-env.py b/scripts/docker/files/bin/setup-test-env.py
index 0f3ea6f4..4868fd56 100755
--- a/scripts/docker/files/bin/setup-test-env.py
+++ b/scripts/docker/files/bin/setup-test-env.py
@@ -194,12 +194,12 @@ def user_db_create(args):
url = 'http://localhost:%d/user-%s' % (args.port, args.uuid)
try:
CouchDatabase.open_database(
- url=url, create=False, replica_uid=None, ensure_ddocs=True)
+ url=url, create=False, replica_uid=None)
print '[*] error: database "user-%s" already exists' % args.uuid
exit(1)
except DatabaseDoesNotExist:
CouchDatabase.open_database(
- url=url, create=True, replica_uid=None, ensure_ddocs=True)
+ url=url, create=True, replica_uid=None)
print '[+] database created: user-%s' % args.uuid
@@ -372,7 +372,10 @@ CERT_CONFIG_FILE = os.path.join(
def cert_create(args):
private_key = os.path.join(args.basedir, args.private_key)
cert_key = os.path.join(args.basedir, args.cert_key)
- os.mkdir(args.basedir)
+ try:
+ os.mkdir(args.basedir)
+ except OSError:
+ pass
call([
'openssl',
'req',
@@ -389,8 +392,11 @@ def cert_create(args):
def cert_delete(args):
private_key = os.path.join(args.basedir, args.private_key)
cert_key = os.path.join(args.basedir, args.cert_key)
- os.unlink(private_key)
- os.unlink(cert_key)
+ try:
+ os.unlink(private_key)
+ os.unlink(cert_key)
+ except OSError:
+ pass
#