Add translation rule to delete ssh auth key from Magnum baymodel

Add a translation rule to ensure that users with existing templates will
not have them break when they update due to the 'ssh_authorized_key'
property having been removed from Magnum and hidden in Heat.

Change-Id: Id73bace93bfc2379e80777da7dc0c0bb059d6cd3
Related-Bug: #1560284
This commit is contained in:
Zane Bitter
2016-03-28 17:19:47 -04:00
committed by Rabi Mishra
parent 451f8c70ac
commit 0ab68f8913

View File

@@ -16,6 +16,7 @@ from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.engine import support
from heat.engine import translation
class BayModel(resource.Resource):
@@ -178,6 +179,16 @@ class BayModel(resource.Resource):
entity = 'baymodels'
def translation_rules(self, props):
if props.get(self.SSH_AUTHORIZED_KEY):
return [
translation.TranslationRule(
props,
translation.TranslationRule.DELETE,
[self.SSH_AUTHORIZED_KEY]
)
]
def handle_create(self):
args = {
'name': self.properties[self.NAME],