tripleo container image delete has a misleading error when image doesn't exist

Bug #1859729 reported by Alex Schultz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
Russell Tweed

Bug Description

[centos@undercloud foo]$ sudo openstack tripleo container image delete --yes docker://undercloud.ctlplane.localdomain:8787/library/centos:7
[centos@undercloud foo]$ sudo openstack tripleo container image delete --yes docker://undercloud.ctlplane.localdomain:8787/library/centos:7
Unable to remove due to permissions. Please prefix command with sudo.
[Errno 2] No such file or directory: '/var/lib/image-serve/v2/library/centos/manifests'
[centos@undercloud foo]$

The 2nd delete probably shouldn't reference running with sudo since it's Errno 2 (no such file) instead of Errno 13 (permission denied)

[centos@undercloud foo]$ openstack tripleo container image delete --yes docker://undercloud.ctlplane.localdomain:8787/tripleomaster/centos-binary-mistral-executor:current-tripleo
Unable to remove due to permissions. Please prefix command with sudo.
[Errno 13] Permission denied: '/var/lib/image-serve/v2/tripleomaster/centos-binary-mistral-executor/manifests/current-tripleo.type-map'

wes hayutin (weshayutin)
Changed in tripleo:
milestone: ussuri-2 → ussuri-3
Changed in tripleo:
assignee: nobody → Russell Tweed (russell-tweed)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-tripleoclient (master)

Fix proposed to branch: master
Review: https://review.opendev.org/709087

Changed in tripleo:
status: Triaged → In Progress
wes hayutin (weshayutin)
Changed in tripleo:
milestone: ussuri-3 → ussuri-rc3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-tripleoclient (master)

Reviewed: https://review.opendev.org/709087
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=54494d2311892cf0b7f3e13705faa3922fb11517
Submitter: Zuul
Branch: master

commit 54494d2311892cf0b7f3e13705faa3922fb11517
Author: Russell Tweed <email address hidden>
Date: Fri Feb 21 10:07:51 2020 +0000

    Only show sudo hints when relevant

    Error message suggesting use of sudo was showing for all exceptions when deleting an image. This change restricts this to only show the 'use sudo' hint when a permissions problem has actually occurred.

    Change-Id: Id976f04e24ce12be0f7b7b3cc9e00487b31efe30
    Closes-Bug: 1859729

Changed in tripleo:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.