create_instance.py Delete Volume on Instance Delete

asked 2019-12-09 17:25:26 -0600

jamesopst gravatar image

hi all,

I stumbled across this control in create_instance.py

vol_delete_on_instance_delete = forms.BooleanField(
    label=_("Delete Volume on Instance Delete"),
    initial=False,
    required=False,
    help_text=_("Delete volume when the instance is deleted"))

can I just change "initial" to be "True" and expect the default button that is selected in Horizon->Launch Instance->Source->Delete Volume on Instance Delete: to be the Yes button?
Maybe there is more to it? I see a create_instance.pyc file do I need to recompile the python to make this effective?

thanks

edit retag flag offensive close merge delete

Comments

do I need to recompile the python to make this effective?

No, just restart whatever process uses create_instance.py. In this case, it's Horizon, which you probably restart by restarting the web server.

Bernd Bausch gravatar imageBernd Bausch ( 2019-12-09 20:13:45 -0600 )edit

settings.py or local_settings.py might be a better place to configure this particular detail, but I am currently unable to check.

Bernd Bausch gravatar imageBernd Bausch ( 2019-12-09 20:14:40 -0600 )edit

thanks Bernd. I've been looking elsewhere based on your suggestion. There are many similar places. But I am not able to find a place where the change is actually applied (even after restarting apache2). If you have any further advice once you are able to check I would totally appreciate it!

jamesopst gravatar imagejamesopst ( 2019-12-10 14:31:17 -0600 )edit

I had to deal with some of this multiple times (e.g. bug), the create_instance.py is not used anymore (as far as I could debug), they changed the create_instance workflow to launch-instance-model.service.js (and similar) underneath /srv/www/openstack..

eblock gravatar imageeblock ( 2019-12-11 01:28:11 -0600 )edit

I tried a couple of changes yesterday in some of these places to change the setting as you need it but to no avail. Maybe you should ask the openstack mailing list.

eblock gravatar imageeblock ( 2019-12-11 01:29:56 -0600 )edit