Browse Source

Delete user creds from DB when no longer required

The user credentials are only for a particular stack and should be deleted
when that stack is deleted.

Fixes #162.

Change-Id: Id5d1f101df17ede1843e4f2fca51903c956667ca
Signed-off-by: Zane Bitter <zbitter@redhat.com>
changes/22/9322/1
Zane Bitter 10 years ago
parent
commit
5f5f22f9b0
  1. 2
      heat/db/sqlalchemy/api.py
  2. 2
      heat/db/sqlalchemy/models.py

2
heat/db/sqlalchemy/api.py

@ -166,9 +166,11 @@ def stack_delete(context, stack_id):
session.delete(r)
rt = s.raw_template
uc = s.user_creds
session.delete(s)
session.delete(rt)
session.delete(uc)
session.flush()

2
heat/db/sqlalchemy/models.py

@ -172,6 +172,8 @@ class UserCreds(BASE, HeatBase):
aws_auth_url = Column(String)
tenant_id = Column(String)
aws_creds = Column(String)
stack = relationship(Stack,
backref=backref('user_creds'))
class Event(BASE, HeatBase):

Loading…
Cancel
Save