Răsfoiți Sursa

Minor issues

Fred Damstra 9 ani în urmă
părinte
comite
cc351321d2
1 a modificat fișierele cu 6 adăugiri și 8 ștergeri
  1. 6 8
      FindSecurityGroupInProfile.py

+ 6 - 8
FindSecurityGroupInProfile.py

@@ -77,15 +77,15 @@ for region in regions:
 		print(str( sys.exc_info() ))
 		continue
 
-	# If we're here, we found at least one
-	FOUND=FOUND+1
-	if DEBUG >= 2:
-		print("FOUND in profile '" + PROFILE + "', Region: '" + region + "': ID=" + str(sg['SecurityGroups'][0]['GroupId']))
-	if FOUND > 1:
-		FOUNDSTR = FOUNDSTR + "\n"
 
+	# If we're here, we found at least one
 	# Add to output
 	for g in sg['SecurityGroups']:
+		FOUND=FOUND+1
+		if DEBUG >= 2:
+			print("FOUND in profile '" + PROFILE + "', Region: '" + region + "': ID=" + str(sg['SecurityGroups'][0]['GroupId']))
+		if FOUND > 1:
+			FOUNDSTR = FOUNDSTR + "\n"
 		FOUNDSTR = FOUNDSTR + "FOUND\t" + PROFILE + "\t" + region + "\t" + str(g['GroupId'])
 
 	continue	# Search next region by ID
@@ -111,8 +111,6 @@ for region in regions:
 
 	# If we're here, we got a result
 	for g in sg['SecurityGroups']:
-		print("-----\n" + str(g) + "\n-----\n")
-#		FOUNDSTR = "FOUND\t" + PROFILE + "\t" + region + "\t" + str(g['GroupId'])
 		FOUND=FOUND+1
 		if DEBUG >= 2:
 			print("FOUND in profile '" + PROFILE + "', Region: '" + region + "': ID=" + str(sg['SecurityGroups'][0]['GroupId']))