File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -70,14 +70,25 @@ def get_containers_list(self):
70
70
"""
71
71
container_list = []
72
72
string_url = self .containers_list_url .replace ('%namespace%' , self .namespace )
73
+ has_next_page = True
74
+ next_page_token = None
73
75
try :
74
- response = call_api (string_url )
75
- if response .status_code == 200 :
76
- json_data = json .loads (response .content .decode ('utf-8' ))
77
- for key in json_data ['repositories' ]:
78
- container = QuayIOContainer (key )
79
- container_list .append (container )
80
- logger .info ("A short description has been retrieved from Quay.io for this container -- " + container .name ())
76
+ while has_next_page :
77
+ next_page = string_url
78
+ if next_page_token :
79
+ next_page = string_url + '&next_page=' + next_page_token
80
+ response = call_api (next_page )
81
+ if response .status_code == 200 :
82
+ json_data = json .loads (response .content .decode ('utf-8' ))
83
+ for key in json_data ['repositories' ]:
84
+ container = QuayIOContainer (key )
85
+ container_list .append (container )
86
+ logger .info ("A short description has been retrieved from Quay.io for this container -- " + container .name ())
87
+ if 'next_page' in json_data :
88
+ has_next_page = True
89
+ next_page_token = json_data ['next_page' ]
90
+ else :
91
+ has_next_page = False
81
92
except (ConnectionError , NewConnectionError ) as error :
82
93
logger .error (" Connection has failed to QuaIO for following url --" + string_url )
83
94
You can’t perform that action at this time.
0 commit comments