Comment 0 for bug 1962496

Revision history for this message
Paul Collins (pjdc) wrote :

If the snap is not already installed the charm can end up creating
/var/snap/telegraf/current as a directory. The installing the snap yields:

ubuntu@juju-b22add-prod-assertions-sign-0:~$ sudo snap install --channel=stable --classic telegraf
error: cannot perform the following tasks:
- Copy snap "telegraf" data (failed to remove snap "telegraf" base directory: remove /var/snap/telegraf: directory not e
mpty)
- Make snap "telegraf" (405) available to the system (cannot cleanup failed attempt at making snap "telegraf" available
to the system: cannot remove snap current symlink: remove /var/snap/telegraf/current: directory not empty)
- Make snap "telegraf" (405) available to the system (symlink 405 /var/snap/telegraf/current: file exists)
ubuntu@juju-b22add-prod-assertions-sign-0:~$ ls -l /var/snap/telegraf/
total 4 drwxr-xr-x 3 root root 4096 Feb 28 22:09 current
ubuntu@juju-b22add-prod-assertions-sign-0:~$ ls -l /var/snap/telegraf/current/
total 4 drwxr-xr-x 2 root root 4096 Feb 28 22:09 telegraf.d

If /var/snap/telegraf/current does not exist, then charm should not create it.