Added wiki generator
This commit is contained in:
@@ -125,6 +125,17 @@ def main():
|
||||
content = f.read()
|
||||
print(f"🔍 File content preview: {content[:100]}...")
|
||||
|
||||
# Clean content - remove command line if present
|
||||
if content.startswith('[command]'):
|
||||
print("⚠️ Detected command prefix, removing...")
|
||||
lines = content.split('\n', 1)
|
||||
if len(lines) > 1:
|
||||
content = lines[1]
|
||||
print(f"🔍 Cleaned content preview: {content[:100]}...")
|
||||
else:
|
||||
print("ERROR: File contains only command line, no JSON data")
|
||||
sys.exit(1)
|
||||
|
||||
# Parse JSON
|
||||
try:
|
||||
terraform_output = json.loads(content)
|
||||
@@ -133,12 +144,18 @@ def main():
|
||||
print(f"Content starts with: {content[:50]}")
|
||||
sys.exit(1)
|
||||
|
||||
# Extract application data
|
||||
apps_data = terraform_output.get('applications_for_wiki', {}).get('value', {})
|
||||
# Extract application data - now terraform_output IS the value
|
||||
apps_data = terraform_output
|
||||
|
||||
if not apps_data:
|
||||
print("ERROR: No applications_for_wiki output found in Terraform output")
|
||||
print(f"Available outputs: {list(terraform_output.keys())}")
|
||||
print("ERROR: No applications data found in Terraform output")
|
||||
print(f"Output content: {terraform_output}")
|
||||
sys.exit(1)
|
||||
|
||||
# Check if we have correct structure
|
||||
if 'proxy_apps' not in apps_data and 'oauth_apps' not in apps_data:
|
||||
print("ERROR: Expected 'proxy_apps' or 'oauth_apps' in output")
|
||||
print(f"Available keys: {list(apps_data.keys())}")
|
||||
sys.exit(1)
|
||||
|
||||
print(f"📊 Found {len(apps_data.get('proxy_apps', {}))} proxy apps, {len(apps_data.get('oauth_apps', {}))} oauth apps")
|
||||
|
||||
Reference in New Issue
Block a user