What are the possible outputs from this command? If I wanted to programmatically check for connectivity to the store, how should I interpret this command? (i.e. will it return non-zero without connectivity?)
$ snap version
snap 2.43.3+git1.8109f8
snapd 2.43.3+git1.8109f8
series 16
ubuntu 20.04
kernel 5.4.0-9-generic
alan@KinkPad-K450:~$ snap info multipass
error: no snap found for "multipass"
alan@KinkPad-K450:~$ snap debug connectivity
Connectivity status:
* api.snapcraft.io: unreachable
error: 1 servers unreachable
Odd that it says multipass is “not found” when in actual fact it can’t connect. I know it can’t connect because I bodged my /etc/hosts to make it broken.
alan@KinkPad-K450:~$ grep api /etc/hosts
127.0.0.1 api.snapcraft.io
The one thing I will say is that while it’s very unlikely we will change snap debug connectivity for any reason, it is a debug command and as such isn’t subject to the typical thing about not breaking compatibility. So if you can do this check another way, I would recommend that, we really try to keep snap debug commands for interactive debugging, not so much for programmatic checks of such things.