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
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
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
Show 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):
...
@@ -179,25 +179,17 @@ def SlapDocument_migrateSlapState(self):
'stopped'
:
'stop_requested'
,
'stopped'
:
'stop_requested'
,
'destroyed'
:
'destroy_requested'
'destroyed'
:
'destroy_requested'
}
}
required_state
=
state_map
[
state
]
if
slap_document
.
getSlapState
()
==
'draft'
:
_jumpToStateFor
=
portal
.
portal_workflow
.
_jumpToStateFor
if
state
==
"started"
:
if
slap_document
.
getSlapState
()
!=
required_state
:
slap_document
.
requestStart
(
comment
=
'Migration.'
,
**
promise_kw
)
_jumpToStateFor
(
slap_document
,
required_state
,
'instance_slap_interface_workflow'
)
elif
state
==
"stopped"
:
if
not
(
slap_document
.
getSlapState
()
==
required_state
):
slap_document
.
requestStop
(
comment
=
'Migration.'
,
**
promise_kw
)
raise
ValueError
(
'%s: %s != %s'
%
(
state
,
slap_document
.
getSlapState
(),
required_state
))
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
]))
# Migrate validation state
# Migrate validation state
if
portal_type
==
'Hosting Subscription'
:
if
portal_type
==
'Hosting Subscription'
:
if
state
==
'destroyed'
:
if
state
==
'destroyed'
:
slap_document
.
validate
()
_jumpToStateFor
(
slap_document
,
'archived'
,
'hosting_subscription_workflow'
)
slap_document
.
archive
()
assert
(
slap_document
.
getValidationState
()
==
'archived'
)
assert
(
slap_document
.
getValidationState
()
==
'archived'
)
else
:
else
:
assert
(
slap_document
.
getValidationState
()
==
'validated'
)
assert
(
slap_document
.
getValidationState
()
==
'validated'
)
...
@@ -205,7 +197,7 @@ def SlapDocument_migrateSlapState(self):
...
@@ -205,7 +197,7 @@ def SlapDocument_migrateSlapState(self):
if
state
==
'destroyed'
and
\
if
state
==
'destroyed'
and
\
(
explanation_delivery_line
.
getPortalType
()
==
'Sale Order Line'
or
\
(
explanation_delivery_line
.
getPortalType
()
==
'Sale Order Line'
or
\
explanation_delivery_line
.
getSimulationState
()
==
'delivered'
):
explanation_delivery_line
.
getSimulationState
()
==
'delivered'
):
slap_document
.
invalidate
(
)
_jumpToStateFor
(
slap_document
,
'invalidated'
,
'item_workflow'
)
else
:
else
:
if
not
(
slap_document
.
getValidationState
()
==
'validated'
):
if
not
(
slap_document
.
getValidationState
()
==
'validated'
):
raise
ValueError
(
'%s != %s'
%
(
slap_document
.
getValidationState
(),
'validated'
))
raise
ValueError
(
'%s != %s'
%
(
slap_document
.
getValidationState
(),
'validated'
))
...
...
master/bt5/vifib_upgrader/bt/revision
View file @
dedb04c2
97
98
\ No newline at end of file
\ 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