Remove drafts for node states transitions validation
Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/2fa8466f Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/2fa8466f Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/2fa8466f Branch: refs/heads/ARIA-126-update-node-statuses Commit: 2fa8466f01a6507de7f627da788b101ea6f152da Parents: 3fe8b06 Author: Avia Efrat <[email protected]> Authored: Thu Mar 23 12:10:41 2017 +0200 Committer: Avia Efrat <[email protected]> Committed: Thu Mar 23 12:10:41 2017 +0200 ---------------------------------------------------------------------- aria/modeling/service_instance.py | 24 ------------------------ 1 file changed, 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/2fa8466f/aria/modeling/service_instance.py ---------------------------------------------------------------------- diff --git a/aria/modeling/service_instance.py b/aria/modeling/service_instance.py index f9e8d7b..a1c264e 100644 --- a/aria/modeling/service_instance.py +++ b/aria/modeling/service_instance.py @@ -366,13 +366,6 @@ class NodeBase(InstanceModelMixin): # pylint: disable=too-many-public-methods STATES = {INITIAL, CREATING, CREATED, CONFIGURING, CONFIGURED, STARTING, STARTED, STOPPING, DELETING, ERROR} - - # TODO implement validation method - # VALID_TRANSITIONS = { - # INITIALIZED: [CREATING], - # STARTED: END_STATES + [CANCELLING], - # CANCELLING: END_STATES + [FORCE_CANCELLING] - # } _op_to_state = {'create': {'transitional': CREATING, 'finished': CREATED}, 'configure': {'transitional': CONFIGURING, 'finished': CONFIGURED}, @@ -388,23 +381,6 @@ class NodeBase(InstanceModelMixin): # pylint: disable=too-many-public-methods except AttributeError: return None - # # TODO implement validation method - # @orm.validates('state') - # def validate_status(self, key, value): - # """Validation function that verifies node state transitions are OK""" - # try: - # current_status = getattr(self, key) - # except AttributeError: - # return - # valid_transitions = self.VALID_TRANSITIONS.get(current_status, []) - # if all([current_status is not None, - # current_status != value, - # value not in valid_transitions]): - # raise ValueError('Cannot change execution status from {current} to {new}'.format( - # current=current_status, - # new=value)) - # return value - @declared_attr def node_template(cls): return relationship.many_to_one(cls, 'node_template')
