Skip to content

Commit

Permalink
Fix creation of components on free clusters (resolves #187) (#188)
Browse files Browse the repository at this point in the history
* Fix creation of components on free clusters (resolves #187)

Signed-off-by: Simon Stone <sstone1@uk.ibm.com>

* Bump version to v0.0.15

Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
  • Loading branch information
Simon Stone authored Apr 23, 2020
1 parent 433f418 commit 512b1ee
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
---
namespace: ibm
name: blockchain_platform
version: 0.0.14
version: 0.0.15
readme: README.md
authors:
- Simon Stone
Expand Down
8 changes: 7 additions & 1 deletion plugins/modules/certificate_authority.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,16 @@ def main():
if tlsca is not None:
merge_dicts(tlsca, bccsp)

# Either create or update the peer.
# Either create or update the certificate authority.
changed = False
if state == 'present' and not certificate_authority_exists:

# Delete the resources and storage configuration for a new certificate
# authority being deployed to a free cluster.
if console.is_free_cluster():
del expected_certificate_authority['resources']
del expected_certificate_authority['storage']

# Create the certificate authority.
certificate_authority = console.create_ca(expected_certificate_authority)
changed = True
Expand Down
6 changes: 6 additions & 0 deletions plugins/modules/ordering_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,12 @@ def main():
storage=module.params['storage']
)

# Delete the resources and storage configuration for a new ordering
# service being deployed to a free cluster.
if console.is_free_cluster():
del expected_ordering_service['resources']
del expected_ordering_service['storage']

# Add the HSM configuration if it is specified.
if hsm is not None:
expected_ordering_service['hsm'] = dict(pkcs11endpoint=pkcs11endpoint)
Expand Down
6 changes: 6 additions & 0 deletions plugins/modules/peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,12 @@ def main():
changed = False
if state == 'present' and not peer_exists:

# Delete the resources and storage configuration for a new peer
# being deployed to a free cluster.
if console.is_free_cluster():
del expected_peer['resources']
del expected_peer['storage']

# Get the config.
expected_peer['config'] = get_config(console, module)

Expand Down

0 comments on commit 512b1ee

Please sign in to comment.