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/3626a46f Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/3626a46f Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/3626a46f Branch: refs/heads/ARIA-126-update-node-statuses Commit: 3626a46fac3593945bd037f0df5bcfc10e1ad605 Parents: 719ad74 Author: Avia Efrat <[email protected]> Authored: Thu Mar 23 12:10:41 2017 +0200 Committer: Avia Efrat <[email protected]> Committed: Sun Mar 26 12:25:33 2017 +0300 ---------------------------------------------------------------------- aria/modeling/service_instance.py | 24 ------------------------ 1 file changed, 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3626a46f/aria/modeling/service_instance.py ---------------------------------------------------------------------- diff --git a/aria/modeling/service_instance.py b/aria/modeling/service_instance.py index bd69f2e..f7a8805 100644 --- a/aria/modeling/service_instance.py +++ b/aria/modeling/service_instance.py @@ -364,13 +364,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}, @@ -386,23 +379,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')
