Skip to content

Commit

Permalink
remove unsupported flags for init chaincode
Browse files Browse the repository at this point in the history
Signed-off-by: Arne Rutjes <[email protected]>
  • Loading branch information
arner authored and celder628 committed Apr 8, 2024
1 parent d0a9aa2 commit a081e60
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions plugins/module_utils/peers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/committed_chaincode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit a081e60

Please sign in to comment.