Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
change node directory format to make scripting easier
Browse files Browse the repository at this point in the history
  • Loading branch information
jr0d committed Jun 6, 2019
1 parent 92347ee commit 7e9c610
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,22 @@ the bash script can take an extra parameter `-b, --bind-directory`. For example
$ ./exhibitor-tls-artifacts -b /tmp 192.168.0.1 192.168.0.2 192.168.0.3
$ sudo tree /tmp/artifacts/
/tmp/artifacts/
├── node_192_168_0_1
./artifacts/
├── 192.168.1.1
│   ├── client-cert.pem
│   ├── client-key.pem
│   ├── clientstore.jks
│   ├── root-cert.pem
│   ├── serverstore.jks
│   └── truststore.jks
├── node_192_168_0_2
├── 192.168.1.2
│   ├── client-cert.pem
│   ├── client-key.pem
│   ├── clientstore.jks
│   ├── root-cert.pem
│   ├── serverstore.jks
│   └── truststore.jks
├── node_192_168_0_3
├── 192.168.1.3
│   ├── client-cert.pem
│   ├── client-key.pem
│   ├── clientstore.jks
Expand All @@ -99,6 +99,7 @@ $ sudo tree /tmp/artifacts/
3 directories, 20 files
```

## Script Usage
Expand All @@ -120,7 +121,7 @@ Options:

All artifacts are found in `./artifacts` or in the user specified directory. This
tool creates sub-directories for each `NODE`. If the node ip address is `10.10.10.10`,
the artifacts for that node will land in `<artifacts_dir>/node_10_10_10_10/`.
the artifacts for that node will land in `<artifacts_dir>/10.10.10.10/`.

* `clientstore.jks`
* Contains `client-cert.pem` and `client-key.pem`.
Expand Down
2 changes: 1 addition & 1 deletion exhibitor_tls_artifacts/gen_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def app(nodes, output_directory):
root_truststore = store_generator.create_truststore([root_cert_path])

for node in nodes:
node_path_name = 'node_' + node.replace('.', '_')
node_path_name = str(node)
client_cert_path, client_key_path = cert_generator.get_cert(
cert_name='client',
node_cert_path=node_path_name,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

VERSION = '0.3'
VERSION = '0.4.0'

with open('requirements.txt') as requirements:
INSTALL_REQUIRES = []
Expand Down
4 changes: 2 additions & 2 deletions tests/test_gen_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_default(self):
catch_exceptions=False)

assert result.exit_code == 0
artifact_path = temp_path / 'artifacts' / 'node_10_10_10_10'
artifact_path = temp_path / 'artifacts' / '10.10.10.10'
assert artifact_path.exists()
self._validate_files(artifact_path)

Expand All @@ -47,7 +47,7 @@ def test_custom_dir(self, tmp_path):
catch_exceptions=False)

assert result.exit_code == 0
self._validate_files(new_path / 'node_10_10_10_10')
self._validate_files(new_path / '10.10.10.10')

def test_dir_exists(self):
""" Test error case when the output directory already exists """
Expand Down

0 comments on commit 7e9c610

Please sign in to comment.