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
Guillaume Hervier
slapos.core
Commits
508ce51f
Commit
508ce51f
authored
May 25, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unused
parent
4592c090
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
125 deletions
+1
-125
master/bt5/vifib_erp5/ExtensionTemplateItem/VifibSecurity.py
master/bt5/vifib_erp5/ExtensionTemplateItem/VifibSecurity.py
+0
-68
master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/SoftwareInstance_destroySlaveInstanceRelated.xml
...fib_core/SoftwareInstance_destroySlaveInstanceRelated.xml
+0
-28
master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/SoftwareInstance_requestDestroySlaveInstanceRelated.xml
...e/SoftwareInstance_requestDestroySlaveInstanceRelated.xml
+0
-28
master/bt5/vifib_erp5/bt/revision
master/bt5/vifib_erp5/bt/revision
+1
-1
No files found.
master/bt5/vifib_erp5/ExtensionTemplateItem/VifibSecurity.py
View file @
508ce51f
...
...
@@ -80,74 +80,6 @@ def SoftwareInstance_bangAsSelf(self, relative_url=None, reference=None,
# Restore the original user.
setSecurityManager
(
sm
)
def
SoftwareInstance_requestDestroySlaveInstanceRelated
(
self
):
""" request destroy all Slave Instance allocated in the Computer Partition
related to the Software Instance """
sm
=
getSecurityManager
()
portal
=
self
.
getPortalObject
()
service_relative_url
=
portal
.
portal_preferences
.
getPreferredInstanceCleanupResource
()
newSecurityManager
(
None
,
portal
.
acl_users
.
getUserById
(
self
.
getReference
()))
computer_partition_relative_url
=
self
.
getAggregateRelatedValue
(
"Sale Packing List Line"
).
getAggregate
(
portal_type
=
"Computer Partition"
)
portal_preferences
=
portal
.
portal_preferences
service_uid_list
=
[
portal
.
restrictedTraverse
(
portal_preferences
.
getPreferredInstanceHostingResource
()).
getUid
(),
portal
.
restrictedTraverse
(
portal_preferences
.
getPreferredInstanceSetupResource
()).
getUid
(),
]
try
:
result_list
=
self
.
portal_catalog
(
portal_type
=
"Sale Packing List Line"
,
aggregate_portal_type
=
"Slave Instance"
,
computer_partition_relative_url
=
computer_partition_relative_url
,
default_resource_uid
=
service_uid_list
)
slave_instance_list
=
[
line
.
getAggregateValue
(
portal_type
=
"Slave Instance"
)
for
line
in
result_list
]
uid_list
=
[]
for
slave_instance
in
slave_instance_list
:
slave_instance_uid
=
slave_instance
.
getUid
()
if
slave_instance_uid
in
uid_list
:
continue
cleanup_packing_list
=
self
.
portal_catalog
(
portal_type
=
'Sale Packing List Line'
,
aggregate_relative_url
=
slave_instance
.
getRelativeUrl
(),
resource_relative_url
=
service_relative_url
,
limit
=
1
,
)
if
len
(
cleanup_packing_list
)
==
0
:
uid_list
.
append
(
slave_instance_uid
)
slave_instance
.
requestDestroyComputerPartition
()
finally
:
# Restore the original user.
setSecurityManager
(
sm
)
def
SoftwareInstance_destroySlaveInstanceRelated
(
self
):
""" destroy all Slave Instance allocated in the Computer Partition
related to the Software Instance """
sm
=
getSecurityManager
()
newSecurityManager
(
None
,
self
.
getPortalObject
().
acl_users
.
getUserById
(
self
.
getReference
()))
portal
=
self
.
getPortalObject
()
portal_preferences
=
portal
.
portal_preferences
computer_partition_relative_url
=
self
.
getAggregateRelatedValue
(
"Sale Packing List Line"
).
getAggregate
(
portal_type
=
"Computer Partition"
)
simulation_state
=
[
"confirmed"
]
service_uid_list
=
[
portal
.
restrictedTraverse
(
portal_preferences
.
getPreferredInstanceCleanupResource
()).
getUid
(),
]
try
:
result_list
=
self
.
portal_catalog
(
portal_type
=
"Sale Packing List Line"
,
aggregate_portal_type
=
"Slave Instance"
,
computer_partition_relative_url
=
computer_partition_relative_url
,
simulation_state
=
simulation_state
,
default_resource_uid
=
service_uid_list
)
slave_instance_list
=
[
line
.
getAggregateValue
(
portal_type
=
"Slave Instance"
)
for
line
in
result_list
]
# restore the original user to destroy each Slave Instance
setSecurityManager
(
sm
)
for
slave_instance
in
slave_instance_list
:
slave_instance
.
destroyComputerPartition
()
finally
:
# Restore the original user.
setSecurityManager
(
sm
)
def
getComputerSecurityCategory
(
self
,
base_category_list
,
user_name
,
object
,
portal_type
):
"""
...
...
master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/SoftwareInstance_destroySlaveInstanceRelated.xml
deleted
100644 → 0
View file @
4592c090
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ExternalMethod"
module=
"Products.ExternalMethod.ExternalMethod"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_function
</string>
</key>
<value>
<string>
SoftwareInstance_destroySlaveInstanceRelated
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
VifibSecurity
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SoftwareInstance_destroySlaveInstanceRelated
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/SoftwareInstance_requestDestroySlaveInstanceRelated.xml
deleted
100644 → 0
View file @
4592c090
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ExternalMethod"
module=
"Products.ExternalMethod.ExternalMethod"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_function
</string>
</key>
<value>
<string>
SoftwareInstance_requestDestroySlaveInstanceRelated
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
VifibSecurity
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SoftwareInstance_requestDestroySlaveInstanceRelated
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_erp5/bt/revision
View file @
508ce51f
431
\ No newline at end of file
432
\ 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