Property "instance.disable_terminate" is always "False" and never actually used.

Bug #1454515 reported by Zhenyu Zheng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
In Progress
Low
Khushbuparakh

Bug Description

The property "instance.disable_terminate" is initialized using:

disable_terminate = Column(Boolean(), default=False)
in \nova\db\sqlalchemy\models.py

This property is then used in

1) compute\api:

def _delete(self, context, instance, delete_type, cb, **instance_attrs):
        if instance.disable_terminate:
            LOG.info(_LI('instance termination disabled'),
                     instance=instance)
            return

2) nova\api\ec2.py:

def _format_attr_disable_api_termination(instance, result):
            result['disableApiTermination'] = instance.disable_terminate

Since there are no API provided to modify this property, it is always "False".

There are two ways to fix this:

1) Add methods to modify this property in servers/create api and servers/update api
to make it actually functional.

2) Remove this property and the whole logic in _delete().
modify nova\api\ec2.py, set result['disableApiTermination'] = False

description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/182953

Changed in nova:
assignee: nobody → Zhenyu Zheng (zhengzhenyu)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Zhenyu Zheng (<email address hidden>) on branch: master
Review: https://review.openstack.org/182953
Reason: Implemented using BP

Changed in nova:
assignee: Zhenyu Zheng (zhengzhenyu) → nobody
status: In Progress → Confirmed
Revision history for this message
John Garbutt (johngarbutt) wrote :

We can look at dropping this instance field in the next instance object, now the ec2 API has been dropped, assuming it really isn't set as part of instance update.

Changed in nova:
importance: Undecided → Low
tags: added: low-hanging-fruit
Changed in nova:
assignee: nobody → Zhenyu Zheng (zhengzhenyu)
Changed in nova:
assignee: Zhenyu Zheng (zhengzhenyu) → Marianne Linhares Monteiro (mariannelinharesm)
Changed in nova:
assignee: Marianne Linhares Monteiro (mariannelinharesm) → nobody
Changed in nova:
assignee: nobody → Sivasathurappan Radhakrishnan (siva-radhakrishnan)
Noopur Shukla (noops.27)
Changed in nova:
assignee: Sivasathurappan Radhakrishnan (siva-radhakrishnan) → Noopur Shukla (noops.27)
Sean Dague (sdague)
Changed in nova:
assignee: Noopur Shukla (noops.27) → nobody
Changed in nova:
assignee: nobody → Khushbuparakh (khushbuparakh)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/488941

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Matt Riedemann (<email address hidden>) on branch: master
Review: https://review.openstack.org/488941

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.