-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_parsing.py
More file actions
31 lines (24 loc) · 1000 Bytes
/
debug_parsing.py
File metadata and controls
31 lines (24 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python3
"""Debug parsing"""
from containnap.docker_manager import RemoteDockerManager
try:
print('🔌 Connecting to 192.168.31.94...')
manager = RemoteDockerManager('192.168.31.94', 'ubuntu', 'ubuntu', 22)
print('\n📋 Raw docker ps -a with tabs output:')
command = "sudo docker ps -a --format 'table {{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Status}}'"
output = manager._execute_command(command)
print(f'Output length: {len(output)}')
print(f'Output repr: {repr(output[:500])}')
lines = output.strip().split('\n')
print(f'\nTotal lines: {len(lines)}')
for i, line in enumerate(lines[:3]):
print(f'\nLine {i}: {repr(line)}')
parts = line.split('\t')
print(f'Parts count: {len(parts)}')
for j, part in enumerate(parts):
print(f' Part {j}: {repr(part)}')
manager.close()
except Exception as e:
print(f'✗ Error: {str(e)}')
import traceback
traceback.print_exc()