From a081e600e11045334058e30a4ad7f585be59795b Mon Sep 17 00:00:00 2001 From: Arne Rutjes Date: Thu, 4 Apr 2024 09:42:35 +0200 Subject: [PATCH] remove unsupported flags for init chaincode Signed-off-by: Arne Rutjes --- plugins/module_utils/peers.py | 10 +--------- plugins/modules/committed_chaincode.py | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/plugins/module_utils/peers.py b/plugins/module_utils/peers.py index f8a7feff..7014d128 100644 --- a/plugins/module_utils/peers.py +++ b/plugins/module_utils/peers.py @@ -401,17 +401,9 @@ def commit_chaincode(self, channel, msp_ids, name, version, sequence, endorsemen else: raise Exception(f'Failed to commit chaincode on peer: {process.stdout} {process.stderr}') - def init_chaincode(self, channel, msp_ids, name, initJsonStr, endorsement_policy_ref, endorsement_policy, endorsement_plugin, validation_plugin, timeout, orderer): + def init_chaincode(self, channel, msp_ids, name, initJsonStr, timeout, orderer): env = self._get_environ() args = ['peer', 'chaincode', 'invoke', '-C', channel, '-n', name, '--isInit', '--ctor', initJsonStr, '--waitForEventTimeout', str(timeout) + "s"] - if endorsement_policy_ref: - args.extend(['--channel-config-policy', endorsement_policy_ref]) - elif endorsement_policy: - args.extend(['--signature-policy', endorsement_policy]) - if endorsement_plugin: - args.extend(['--endorsement-plugin', endorsement_plugin]) - if validation_plugin: - args.extend(['--validation-plugin', validation_plugin]) args.extend(self._get_anchor_peers(channel, msp_ids)) args.extend(self._get_ordering_service(channel, orderer)) process = self._run_command(args, env) diff --git a/plugins/modules/committed_chaincode.py b/plugins/modules/committed_chaincode.py index 8e1e81f2..553db745 100644 --- a/plugins/modules/committed_chaincode.py +++ b/plugins/modules/committed_chaincode.py @@ -405,7 +405,7 @@ def main(): peer_connection.commit_chaincode(channel, msp_ids, name, version, sequence, endorsement_policy_ref, endorsement_policy, endorsement_plugin, validation_plugin, init_required, collections_config, timeout, orderer) changed = True if init_required: - peer_connection.init_chaincode(channel, msp_ids, name, initJsonStr, endorsement_policy_ref, endorsement_policy, endorsement_plugin, validation_plugin, timeout, orderer) + peer_connection.init_chaincode(channel, msp_ids, name, initJsonStr, timeout, orderer) # Return the committed chaincode. return module.exit_json(changed=changed, committed_chaincode=dict(channel=channel, name=name, version=version, sequence=sequence, endorsement_policy_ref=endorsement_policy_ref, endorsement_policy=endorsement_policy, endorsement_plugin=endorsement_plugin, validation_plugin=validation_plugin, init_required=init_required, collections_config=collections_config))