Skip to content

Commit

Permalink
Update to support K8S 1.25 (IBM-Blockchain#638)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew B White <[email protected]>

Signed-off-by: Matthew B White <[email protected]>
  • Loading branch information
mbwhite committed Jan 27, 2023
1 parent 1170b1f commit 852fbde
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions plugins/module_utils/peers.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,16 @@ def approve_chaincode(self, channel, name, version, package_id, sequence, endors
else:
raise Exception(f'Failed to approve chaincode on peer: {process.stdout}')

def query_approved_chaincodes(self, channel):
env = self._get_environ()
args = ['peer', 'lifecycle', 'chaincode', 'queryapproved', '-C', channel, '-O', 'json']
process = self._run_command(args, env)
if process.returncode == 0:
data = json.loads(process.stdout)
return data.get('chaincode_definitions', [])
else:
raise Exception(f'Failed to query approved chaincodes on peer: {process.stdout}')

def query_committed_chaincodes(self, channel):
env = self._get_environ()
args = ['peer', 'lifecycle', 'chaincode', 'querycommitted', '-C', channel, '-O', 'json']
Expand Down

0 comments on commit 852fbde

Please sign in to comment.