Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Carlos Ramos Carreño
slapos.core
Commits
68a50590
You need to sign in or sign up before continuing.
Commit
68a50590
authored
13 years ago
by
Antoine Catton
Browse files
Options
Download
Email Patches
Plain Diff
Adding renamming capability.
parent
5f2398a2
Changes
8
Hide 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>
This diff is collapsed.
Click to expand it.
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/states/destroy_requested.xml
View file @
68a50590
...
...
@@ -24,6 +24,7 @@
<tuple>
<string>
destroy_computer_partition
</string>
<string>
destroy_requested
</string>
<string>
rename
</string>
<string>
report_computer_partition_bang
</string>
<string>
report_computer_partition_error
</string>
<string>
request_computer_partition
</string>
...
...
This diff is collapsed.
Click to expand it.
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/states/start_requested.xml
View file @
68a50590
...
...
@@ -24,6 +24,7 @@
<tuple>
<string>
destroy_computer_partition
</string>
<string>
destroy_requested
</string>
<string>
rename
</string>
<string>
report_computer_partition_bang
</string>
<string>
report_computer_partition_error
</string>
<string>
request_computer_partition
</string>
...
...
This diff is collapsed.
Click to expand it.
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/states/stop_requested.xml
View file @
68a50590
...
...
@@ -24,6 +24,7 @@
<tuple>
<string>
destroy_computer_partition
</string>
<string>
destroy_requested
</string>
<string>
rename
</string>
<string>
report_computer_partition_bang
</string>
<string>
report_computer_partition_error
</string>
<string>
request_computer_partition
</string>
...
...
This diff is collapsed.
Click to expand it.
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>
This diff is collapsed.
Click to expand it.
master/bt5/vifib_base/bt/revision
View file @
68a50590
325
\ No newline at end of file
326
\ No newline at end of file
This diff is collapsed.
Click to expand it.
master/product/Vifib/Tool/SlapTool.py
View file @
68a50590
...
...
@@ -245,6 +245,14 @@ class SlapTool(BaseTool):
return
self
.
_softwareInstanceError
(
computer_id
,
computer_partition_id
,
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
,
'softwareInstanceBang'
)
def
softwareInstanceBang
(
self
,
computer_id
,
...
...
@@ -626,6 +634,15 @@ class SlapTool(BaseTool):
computer_partition_id
).
reportComputerPartitionError
(
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
def
_softwareInstanceBang
(
self
,
computer_id
,
computer_partition_id
,
message
):
...
...
This diff is collapsed.
Click to expand it.
slapos/slap/slap.py
View file @
68a50590
...
...
@@ -378,6 +378,14 @@ class ComputerPartition(SlapDocument):
'computer_partition_id'
:
self
.
_partition_id
,
'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
):
return
self
.
_partition_id
...
...
This diff is collapsed.
Click to expand it.
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