diff --git a/plugins/module_utils/peers.py b/plugins/module_utils/peers.py index f8a7fef..7014d12 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 8e1e81f..553db74 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))