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
68a50590
Commit
68a50590
authored
Nov 23, 2011
by
Antoine Catton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding renamming capability.
parent
5f2398a2
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
166 additions
and
1 deletion
+166
-1
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/scripts/SoftwareInstance_rename.xml
...ap_interface_workflow/scripts/SoftwareInstance_rename.xml
+75
-0
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/states/destroy_requested.xml
...ance_slap_interface_workflow/states/destroy_requested.xml
+1
-0
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/states/start_requested.xml
...stance_slap_interface_workflow/states/start_requested.xml
+1
-0
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/states/stop_requested.xml
...nstance_slap_interface_workflow/states/stop_requested.xml
+1
-0
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/transitions/rename.xml
...e_instance_slap_interface_workflow/transitions/rename.xml
+62
-0
master/bt5/vifib_base/bt/revision
master/bt5/vifib_base/bt/revision
+1
-1
master/product/Vifib/Tool/SlapTool.py
master/product/Vifib/Tool/SlapTool.py
+17
-0
slapos/slap/slap.py
slapos/slap/slap.py
+8
-0
No files found.
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/scripts/SoftwareInstance_rename.xml
0 → 100644
View file @
68a50590
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
# Get the software_instance\n
software_instance = state_change[\'object\']\n
\n
# Change the title\n
software_instance.edit(title=state_change.kwargs[\'new_name\'])\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
state_change
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SoftwareInstance_rename
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Rename software instance
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/states/destroy_requested.xml
View file @
68a50590
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
<tuple>
<tuple>
<string>
destroy_computer_partition
</string>
<string>
destroy_computer_partition
</string>
<string>
destroy_requested
</string>
<string>
destroy_requested
</string>
<string>
rename
</string>
<string>
report_computer_partition_bang
</string>
<string>
report_computer_partition_bang
</string>
<string>
report_computer_partition_error
</string>
<string>
report_computer_partition_error
</string>
<string>
request_computer_partition
</string>
<string>
request_computer_partition
</string>
...
...
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/states/start_requested.xml
View file @
68a50590
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
<tuple>
<tuple>
<string>
destroy_computer_partition
</string>
<string>
destroy_computer_partition
</string>
<string>
destroy_requested
</string>
<string>
destroy_requested
</string>
<string>
rename
</string>
<string>
report_computer_partition_bang
</string>
<string>
report_computer_partition_bang
</string>
<string>
report_computer_partition_error
</string>
<string>
report_computer_partition_error
</string>
<string>
request_computer_partition
</string>
<string>
request_computer_partition
</string>
...
...
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/states/stop_requested.xml
View file @
68a50590
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
<tuple>
<tuple>
<string>
destroy_computer_partition
</string>
<string>
destroy_computer_partition
</string>
<string>
destroy_requested
</string>
<string>
destroy_requested
</string>
<string>
rename
</string>
<string>
report_computer_partition_bang
</string>
<string>
report_computer_partition_bang
</string>
<string>
report_computer_partition_error
</string>
<string>
report_computer_partition_error
</string>
<string>
request_computer_partition
</string>
<string>
request_computer_partition
</string>
...
...
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/transitions/rename.xml
0 → 100644
View file @
68a50590
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"TransitionDefinition"
module=
"Products.DCWorkflow.Transitions"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
actbox_category
</string>
</key>
<value>
<string>
workflow
</string>
</value>
</item>
<item>
<key>
<string>
actbox_icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
actbox_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
actbox_url
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
after_script_name
</string>
</key>
<value>
<string>
SoftwareInstance_rename
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
guard
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
rename
</string>
</value>
</item>
<item>
<key>
<string>
new_state_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
script_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Rename Software Instance
</string>
</value>
</item>
<item>
<key>
<string>
trigger_type
</string>
</key>
<value>
<int>
2
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_base/bt/revision
View file @
68a50590
325
326
\ No newline at end of file
\ No newline at end of file
master/product/Vifib/Tool/SlapTool.py
View file @
68a50590
...
@@ -245,6 +245,14 @@ class SlapTool(BaseTool):
...
@@ -245,6 +245,14 @@ class SlapTool(BaseTool):
return
self
.
_softwareInstanceError
(
computer_id
,
computer_partition_id
,
return
self
.
_softwareInstanceError
(
computer_id
,
computer_partition_id
,
error_log
)
error_log
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'softwareInstanceRename'
)
def
softwareInstanceRename
(
self
,
new_name
,
computer_id
,
computer_partition_id
,
slave_reference
=
None
):
return
self
.
_softwareInstanceRename
(
new_name
,
computer_id
,
computer_partition_id
,
slave_reference
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'softwareInstanceBang'
)
'softwareInstanceBang'
)
def
softwareInstanceBang
(
self
,
computer_id
,
def
softwareInstanceBang
(
self
,
computer_id
,
...
@@ -626,6 +634,15 @@ class SlapTool(BaseTool):
...
@@ -626,6 +634,15 @@ class SlapTool(BaseTool):
computer_partition_id
).
reportComputerPartitionError
(
computer_partition_id
).
reportComputerPartitionError
(
comment
=
error_log
)
comment
=
error_log
)
@
convertToREST
def
_softwareInstanceRename
(
self
,
new_name
,
computer_id
,
computer_partition_id
,
slave_reference
):
software_instance
=
self
.
_getSoftwareInstanceForComputerPartition
(
computer_id
,
computer_partition_id
,
slave_reference
)
return
software_instance
.
rename
(
new_name
=
new_name
,
comment
=
"Rename %s into %s"
%
(
software_instance
.
title
,
new_name
))
@
convertToREST
@
convertToREST
def
_softwareInstanceBang
(
self
,
computer_id
,
def
_softwareInstanceBang
(
self
,
computer_id
,
computer_partition_id
,
message
):
computer_partition_id
,
message
):
...
...
slapos/slap/slap.py
View file @
68a50590
...
@@ -378,6 +378,14 @@ class ComputerPartition(SlapDocument):
...
@@ -378,6 +378,14 @@ class ComputerPartition(SlapDocument):
'computer_partition_id'
:
self
.
_partition_id
,
'computer_partition_id'
:
self
.
_partition_id
,
'message'
:
message
})
'message'
:
message
})
def
rename
(
self
,
new_name
,
slave_reference
=
None
):
self
.
_connection_helper
.
POST
(
'/rename'
,
{
'computer_id'
:
self
.
_computer_id
,
'computer_partition_id'
:
self
.
_computer_id
,
'new_name'
:
new_name
,
'slave_reference'
:
slave_reference
,
})
def
getId
(
self
):
def
getId
(
self
):
return
self
.
_partition_id
return
self
.
_partition_id
...
...
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