Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lu Xu
slapos.core
Commits
dedb04c2
Commit
dedb04c2
authored
May 30, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use low level workflow migration.
parent
579d3c69
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
17 deletions
+9
-17
master/bt5/vifib_upgrader/ExtensionTemplateItem/VifibUpgrader.py
...bt5/vifib_upgrader/ExtensionTemplateItem/VifibUpgrader.py
+8
-16
master/bt5/vifib_upgrader/bt/revision
master/bt5/vifib_upgrader/bt/revision
+1
-1
No files found.
master/bt5/vifib_upgrader/ExtensionTemplateItem/VifibUpgrader.py
View file @
dedb04c2
...
...
@@ -179,25 +179,17 @@ def SlapDocument_migrateSlapState(self):
'stopped'
:
'stop_requested'
,
'destroyed'
:
'destroy_requested'
}
if
slap_document
.
getSlapState
()
==
'draft'
:
if
state
==
"started"
:
slap_document
.
requestStart
(
comment
=
'Migration.'
,
**
promise_kw
)
elif
state
==
"stopped"
:
slap_document
.
requestStop
(
comment
=
'Migration.'
,
**
promise_kw
)
elif
state
==
"destroyed"
:
raise
NotImplementedError
slap_document
.
requestDestroy
(
comment
=
'Migration.'
,
**
promise_kw
)
else
:
raise
ValueError
(
"Unknown state %s for %s"
%
(
state
,
slap_document
.
getRelativeUrl
()))
if
not
(
slap_document
.
getSlapState
()
==
state_map
[
state
]):
raise
ValueError
(
'%s: %s != %s'
%
(
state
,
slap_document
.
getSlapState
(),
state_map
[
state
]))
required_state
=
state_map
[
state
]
_jumpToStateFor
=
portal
.
portal_workflow
.
_jumpToStateFor
if
slap_document
.
getSlapState
()
!=
required_state
:
_jumpToStateFor
(
slap_document
,
required_state
,
'instance_slap_interface_workflow'
)
if
not
(
slap_document
.
getSlapState
()
==
required_state
):
raise
ValueError
(
'%s: %s != %s'
%
(
state
,
slap_document
.
getSlapState
(),
required_state
))
# Migrate validation state
if
portal_type
==
'Hosting Subscription'
:
if
state
==
'destroyed'
:
slap_document
.
validate
()
slap_document
.
archive
()
_jumpToStateFor
(
slap_document
,
'archived'
,
'hosting_subscription_workflow'
)
assert
(
slap_document
.
getValidationState
()
==
'archived'
)
else
:
assert
(
slap_document
.
getValidationState
()
==
'validated'
)
...
...
@@ -205,7 +197,7 @@ def SlapDocument_migrateSlapState(self):
if
state
==
'destroyed'
and
\
(
explanation_delivery_line
.
getPortalType
()
==
'Sale Order Line'
or
\
explanation_delivery_line
.
getSimulationState
()
==
'delivered'
):
slap_document
.
invalidate
(
)
_jumpToStateFor
(
slap_document
,
'invalidated'
,
'item_workflow'
)
else
:
if
not
(
slap_document
.
getValidationState
()
==
'validated'
):
raise
ValueError
(
'%s != %s'
%
(
slap_document
.
getValidationState
(),
'validated'
))
...
...
master/bt5/vifib_upgrader/bt/revision
View file @
dedb04c2
97
\ No newline at end of file
98
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment