Skip to content

Commit 666bdc0

Browse files
authored
[sonic-package-manager] Drop 'expires_in' (#2002)
#### What I did The 'expires_in' attribute for tokens is defined as optional and some Docker repositories (notably ghcr.io) do not set it. #### How I did it Since 'expires_in' is not used anywhere in the code, we simply drop it. #### How to verify it Try to install a SONiC package from `ghcr.io`. E.g.: ``` sudo sonic-package-manager install --from-repository ghcr.io/kamelnetworks/sonic_exporter:main ``` #### Previous command output (if the output of a command-line utility has changed) ``` ghcr.io/kamelnetworks/sonic_exporter:main is going to be installed, continue? [y/N]: y Failed to install ghcr.io/kamelnetworks/sonic_exporter:main: 'expires_in' ``` #### New command output (if the output of a command-line utility has changed) Output as expected
1 parent 52ac8ac commit 666bdc0

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

sonic_package_manager/registry.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@ def get_token(bearer: Dict) -> str:
4343

4444
content = json.loads(response.content)
4545
token = content['token']
46-
expires_in = content['expires_in']
4746

4847
log.debug(f'authentication token for bearer={bearer}: '
49-
f'token={token} expires_in={expires_in}')
48+
f'token={token}')
5049

5150
return token
5251

0 commit comments

Comments
 (0)