File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,16 +55,16 @@ def main():
5555 )
5656
5757 try :
58- pcs = list ( client .policy_checks .list (args .run_id , options ) )
58+ pc_list = client .policy_checks .list (args .run_id , options )
5959
60- print (f"Total policy checks: { len ( pcs ) } " )
61- print ("Page N/A of N/A " )
60+ print (f"Total policy checks: { pc_list . total_count } " )
61+ print (f "Page { pc_list . current_page } of { pc_list . total_pages } " )
6262 print ()
6363
64- if not pcs :
64+ if not pc_list . items :
6565 print ("No policy checks found for this run." )
6666 else :
67- for pc in pcs :
67+ for pc in pc_list . items :
6868 print (f"- ID: { pc .id } " )
6969 print (f"Status: { pc .status } " )
7070 print (f"Scope: { pc .scope } " )
Original file line number Diff line number Diff line change @@ -21,15 +21,8 @@ def main():
2121 # Initialize the TFE client
2222 client = TFEClient (TFEConfig .from_env ())
2323
24- # Resolve organization and workspace from environment variables
25- org_name = os .environ ["TFE_ORG" ]
26- workspace_name = os .getenv ("TFE_WORKSPACE_NAME" , "test-api" )
27- workspace_id = os .getenv ("TFE_WORKSPACE_ID" , "" ).strip ()
28- if not workspace_id :
29- print (f"Looking up workspace '{ workspace_name } ' in org '{ org_name } '..." )
30- ws = client .workspaces .read (workspace_name , organization = org_name )
31- workspace_id = ws .id
32- print (f"Resolved workspace ID: { workspace_id } " )
24+ # Replace this with your actual workspace ID
25+ workspace_id = "ws-example123456789" # Get this from your TFE workspace
3326
3427 print (f"Testing all variable operations in workspace: { workspace_id } " )
3528 print ("=" * 60 )
You can’t perform that action at this time.
0 commit comments