Skip to content

Commit

Permalink
Fix pre-commit issues
Browse files Browse the repository at this point in the history
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
  • Loading branch information
phracek committed Jun 3, 2024
1 parent 7e5e86d commit f8a5063
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions show_all_imagestreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import json
import os
import sys

from pathlib import Path
from typing import Dict, Any
Expand All @@ -32,18 +33,13 @@


class ShowAllImageStreams(object):
version: str = ""

def __init__(self):
pass

def load_json_file(self, filename: Path) -> Any:
with open(str(filename)) as f:
data = json.load(f)
isinstance(data, Dict)
return data

def show_all_imagestreams(self):
def show_all_imagestreams(self) -> int:
p = Path(".")
json_files = p.glob(f"{IMAGESTREAMS_DIR}/*.json")
if not json_files:
Expand All @@ -57,8 +53,9 @@ def show_all_imagestreams(self):
print(f"Tags in the image stream {f}:")
for tag in json_dict["spec"]["tags"]:
print(f"- {tag['name']} -> {tag['from']['name']}")
return 0


if __name__ == "__main__":
isc = ShowAllImageStreams()
isc.show_all_imagestreams()
sys.exit(isc.show_all_imagestreams())

0 comments on commit f8a5063

Please sign in to comment.