File tree 1 file changed +4
-7
lines changed
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 24
24
25
25
import json
26
26
import os
27
+ import sys
27
28
28
29
from pathlib import Path
29
30
from typing import Dict , Any
32
33
33
34
34
35
class ShowAllImageStreams (object ):
35
- version : str = ""
36
-
37
- def __init__ (self ):
38
- pass
39
-
40
36
def load_json_file (self , filename : Path ) -> Any :
41
37
with open (str (filename )) as f :
42
38
data = json .load (f )
43
39
isinstance (data , Dict )
44
40
return data
45
41
46
- def show_all_imagestreams (self ):
42
+ def show_all_imagestreams (self ) -> int :
47
43
p = Path ("." )
48
44
json_files = p .glob (f"{ IMAGESTREAMS_DIR } /*.json" )
49
45
if not json_files :
@@ -57,8 +53,9 @@ def show_all_imagestreams(self):
57
53
print (f"Tags in the image stream { f } :" )
58
54
for tag in json_dict ["spec" ]["tags" ]:
59
55
print (f"- { tag ['name' ]} -> { tag ['from' ]['name' ]} " )
56
+ return 0
60
57
61
58
62
59
if __name__ == "__main__" :
63
60
isc = ShowAllImageStreams ()
64
- isc .show_all_imagestreams ()
61
+ sys . exit ( isc .show_all_imagestreams () )
You can’t perform that action at this time.
0 commit comments