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:
@@ -16,6 +16,7 @@ from heat.engine import constraints
|
|||||||
from heat.engine import properties
|
from heat.engine import properties
|
||||||
from heat.engine import resource
|
from heat.engine import resource
|
||||||
from heat.engine import support
|
from heat.engine import support
|
||||||
|
from heat.engine import translation
|
||||||
|
|
||||||
|
|
||||||
class BayModel(resource.Resource):
|
class BayModel(resource.Resource):
|
||||||
@@ -178,6 +179,16 @@ class BayModel(resource.Resource):
|
|||||||
|
|
||||||
entity = 'baymodels'
|
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):
|
def handle_create(self):
|
||||||
args = {
|
args = {
|
||||||
'name': self.properties[self.NAME],
|
'name': self.properties[self.NAME],
|
||||||
|
|||||||
Reference in New Issue
Block a user