Skip to content

Commit

Permalink
status: fix git
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed May 9, 2024
1 parent 2a45db0 commit 4816730
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion framework/internal/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def exec(service: str, command: list[str], timeout: int = 120) -> tuple[int, byt
STATUS_CACHE.update({service: status(service)})
container = STATUS_CACHE.get(service, {}).get('Name', None)
if container is None:
print(f"Container for {service} not found", file=sys.stderr)
return 1, b''

cmd = ['docker', 'exec', container] + command
Expand Down
8 changes: 5 additions & 3 deletions framework/status-json.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def get_timestamp():
return int(time.time())

def get_revision():
cmd = ['git', 'describe', '--dirty' '--always']
cmd = ['git', 'describe', '--dirty', '--always']
return subprocess.check_output(cmd, timeout=5).decode('utf-8').strip()

def get_services():
Expand Down Expand Up @@ -59,9 +59,11 @@ def get_ndnping():
ping_prefix = host['default_prefix']

if ping_prefix:
print(f'ndnping {host_name} with prefix {ping_prefix}', file=sys.stderr)
print(f'ndnping {host_name} with prefix {ping_prefix} -> ', file=sys.stderr, end='', flush=True)
code, _ = compose.exec('ndnpingserver', ['ndnping', '-c', '3', '-i', '10', ping_prefix], timeout=10)
result[host_name] = code == 0
success = code == 0
result[host_name] = success
print('success' if success else 'fail', file=sys.stderr)

return result

Expand Down

0 comments on commit 4816730

Please sign in to comment.