remove-services action could use a '--dry-run'

Bug #1935080 reported by Adam Dyess
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Cinder Charm

Bug Description

I ended up having to read through the code of the action to determine if it really would run

cinder-manage service remove cinder-scheduler juju-2a61ce-46-lxd-10
cinder-manage service remove cinder-volume juju-2a61ce-46-lxd-10@LVM

Hints -- in the end it wouldn't have, the 'cinder-volume' host name wasn't an exact match, so it would have only run the first subprocess.

Could you add a dry-run defaults to False on the action so that an operator could see WHAT the action intends to do before it does so?

It would have also been nice to have an action 'show-services' which would list which services are active on this host.

And finally:
please consider changing the action in `remove_services` method

def remove_services(args):
    host = action_get(key="host")
    services = cinder_manage_service_list()

    if host not in ("unused", "",):
- services = [s for s in services if == host]
+ services = [s for s in services if]
        services = [s for s in services if not in DEFAULT_SERVICES]

so that these @LVM hostnames will also be adjusted by this action

Revision history for this message
Adam Dyess (addyess) wrote :

workaround issue:

juju run -u cinder/$unit '
  cinder-manage service remove cinder-scheduler $(hostname)
  cinder-manage service remove cinder-volume $(hostname)@LVM

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.