@@ -36,11 +36,11 @@ def main():
3636 address = os .environ .get ("TFE_ADDRESS" , "https://app.terraform.io" )
3737
3838 if not token :
39- print (" TFE_TOKEN environment variable is required" )
39+ print ("TFE_TOKEN environment variable is required" )
4040 return 1
4141
4242 if not org :
43- print (" TFE_ORG environment variable is required" )
43+ print ("TFE_ORG environment variable is required" )
4444 return 1
4545
4646 # Create TFE client
@@ -58,7 +58,7 @@ def main():
5858 # Convert to list to check if empty and get count
5959 pool_list = list (agent_pools )
6060 if not pool_list :
61- print (" No agent pools found. Create an agent pool first." )
61+ print ("No agent pools found. Create an agent pool first." )
6262 return 1
6363
6464 print (f"Found { len (pool_list )} agent pools:" )
@@ -81,27 +81,27 @@ def main():
8181 if agent_list :
8282 total_agents += len (agent_list )
8383 for agent in agent_list :
84- print (f" - Agent { agent .id } " )
85- print (f" Name: { agent .name or 'Unnamed' } " )
86- print (f" Status: { agent .status } " )
87- print (f" Version: { agent .version or 'Unknown' } " )
88- print (f" IP: { agent .ip_address or 'Unknown' } " )
89- print (f" Last Ping: { agent .last_ping_at or 'Never' } " )
84+ print (f"Agent { agent .id } " )
85+ print (f"Name: { agent .name or 'Unnamed' } " )
86+ print (f"Status: { agent .status } " )
87+ print (f"Version: { agent .version or 'Unknown' } " )
88+ print (f"IP: { agent .ip_address or 'Unknown' } " )
89+ print (f"Last Ping: { agent .last_ping_at or 'Never' } " )
9090
9191 # Example 3: Read detailed agent information
9292 try :
9393 agent_details = client .agents .read (agent .id )
94- print (" Agent details retrieved successfully" )
95- print (f" Full name: { agent_details .name or 'Unnamed' } " )
96- print (f" Current status: { agent_details .status } " )
94+ print ("Agent details retrieved successfully" )
95+ print (f"Full name: { agent_details .name or 'Unnamed' } " )
96+ print (f"Current status: { agent_details .status } " )
9797 except NotFound :
98- print (" Agent details not accessible" )
98+ print ("Agent details not accessible" )
9999 except Exception as e :
100- print (f" Error reading agent details: { e } " )
100+ print (f"Error reading agent details: { e } " )
101101
102102 print ("" )
103103 else :
104- print (" No agents found in this pool" )
104+ print ("No agents found in this pool" )
105105
106106 if total_agents == 0 :
107107 print ("\n No agents found in any pools." )
0 commit comments