[
https://issues.apache.org/jira/browse/ARIA-126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15943195#comment-15943195
]
ASF GitHub Bot commented on ARIA-126:
-------------------------------------
Github user AviaE commented on a diff in the pull request:
https://github.com/apache/incubator-ariatosca/pull/83#discussion_r108060063
--- Diff: aria/modeling/service_instance.py ---
@@ -347,6 +349,46 @@ class NodeBase(InstanceModelMixin): # pylint:
disable=too-many-public-methods
'node_template_fk',
'service_name']
+ INITIAL = 'initial'
+ CREATING = 'creating'
+ CREATED = 'created'
+ CONFIGURING = 'configuring'
+ CONFIGURED = 'configured'
+ STARTING = 'starting'
+ STARTED = 'started'
+ STOPPING = 'stopping'
+ DELETING = 'deleting'
+ DELETED = 'deleted'
+ # TODO decide what happens to a node's state after its 'deleting'
state, as
+ # this is not defined as part of the tosca spec.
+ ERROR = 'error'
+
+ STATES = [INITIAL, CREATING, CREATED, CONFIGURING, CONFIGURED,
STARTING, STARTED, STOPPING,
+ DELETING, DELETED, ERROR]
+
+ _op_to_state = {'create': {'transitional': CREATING, 'finished':
CREATED},
+ 'configure': {'transitional': CONFIGURING, 'finished':
CONFIGURED},
+ 'start': {'transitional': STARTING, 'finished':
STARTED},
+ 'stop': {'transitional': STOPPING, 'finished':
CONFIGURED},
+ 'delete': {'transitional': DELETING, 'finished':
DELETED}}
+
+ @classmethod
+ def determine_state(cls, op_name, transitional):
--- End diff --
is_transitional
> Update state of nodes during normative lifecycle execution
> ----------------------------------------------------------
>
> Key: ARIA-126
> URL: https://issues.apache.org/jira/browse/ARIA-126
> Project: AriaTosca
> Issue Type: Story
> Reporter: Avia Efrat
> Assignee: Avia Efrat
>
> Update a node's state while preforming tasks that reflect changes to its
> state.
> Currently, this will be hardcoded specifically for lifecycle operations, i.e.
> `created`, `configured`, `started` etc.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)