summaryrefslogtreecommitdiff
path: root/mklog.py
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2015-06-05 12:11:09 +0200
committerLinus Nordberg <linus@nordu.net>2015-06-05 12:11:09 +0200
commit5ed094822b28eb1ca871864e49f63f23d4a6cf68 (patch)
tree4ff2e50c67848e98250bce7587c1fd0d61b8dde6 /mklog.py
parent228aae4427925c7f62f19b96ea009f448fd68b97 (diff)
Don't recreate authkeys.
Diffstat (limited to 'mklog.py')
-rwxr-xr-xmklog.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/mklog.py b/mklog.py
index f8f3510..8c7f89a 100755
--- a/mklog.py
+++ b/mklog.py
@@ -114,17 +114,20 @@ def make_authkeys(nodenames):
os.mkdir(wdir)
os.chdir(wdir)
+ priv_dst = '../nodes/%s/%s-private.pem' % (nodename, nodename)
+ pub_dst = '../nodes/%s/publickeys' % nodename
+
for nodename in nodenames:
+ if os.access(priv_dst, os.R_OK):
+ continue
if not make_eckey(nodename):
return False
- dst = '../nodes/%s/%s-private.pem' % (nodename, nodename)
- if os.access(dst, os.F_OK) and not os.access(dst, os.W_OK):
- os.chmod(dst, stat.S_IWUSR)
- shutil.move('%s-private.pem' % nodename, dst)
+ if os.access(priv_dst, os.F_OK) and not os.access(priv_dst, os.W_OK):
+ os.chmod(priv_dst, stat.S_IWUSR)
+ shutil.move('%s-private.pem' % nodename, priv_dst)
for nodename in nodenames:
- dst = '../nodes/%s/publickeys' % nodename
- shutil.rmtree(dst, ignore_errors=True)
- shutil.copytree('.', dst)
+ shutil.rmtree(pub_dst, ignore_errors=True)
+ shutil.copytree('.', pub_dst)
os.chdir('..')
return True