File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -187,7 +187,6 @@ def prepare_initrd(architecture, rootfs_format='cpio'):
187187 # First, make sure that the current user is not rate limited by GitHub,
188188 # otherwise the next API call will not return valid information.
189189 gh_json_rl = get_gh_json ('https://api.github.com/rate_limit' )
190- limit = gh_json_rl ['resources' ]['core' ]['limit' ]
191190 remaining = gh_json_rl ['resources' ]['core' ]['remaining' ]
192191
193192 # If we have API calls remaining, we can query for the latest release to
@@ -206,6 +205,7 @@ def prepare_initrd(architecture, rootfs_format='cpio'):
206205 if cur_rel != latest_rel :
207206 download_initrd (gh_json_rel , src )
208207 elif not src .exists ():
208+ limit = gh_json_rl ['resources' ]['core' ]['limit' ]
209209 raise RuntimeError (
210210 f"Cannot query GitHub API for latest images release due to rate limit (remaining: { remaining } , limit: { limit } ) and { src } does not exist already! "
211211 'Download it manually or supply a GitHub personal access token via the GITHUB_TOKEN environment variable to make an authenticated GitHub API request.'
You can’t perform that action at this time.
0 commit comments