Commit bc499f13 authored by Romain Courteaud's avatar Romain Courteaud

XXXXXXXXXXXXXXXXXXXXXXXXXXX EXPAND

slapos_*: drop open/personal allocation_scope
parent 2846de64
......@@ -3,6 +3,7 @@ portal = context.getPortalObject()
compute_partition_list = portal.portal_catalog(
software_release_url=context.getUrlString(),
free_for_request=1,
follow_up__uid=context.getFollowUpUid(),
group_by=("parent_uid",)
)
......
......@@ -2,7 +2,6 @@ compute_node = state_change['object']
portal = compute_node.getPortalObject()
person = portal.portal_membership.getAuthenticatedMember().getUserValue()
compute_node.edit(
allocation_scope='open/personal',
source_administration_value=person,
upgrade_scope='auto',
capacity_scope='open'
......
......@@ -109,6 +109,11 @@ if aggregate_portal_type == "Instance Tree":
message_list.append("%s has error (%s, %s at %s scope %s)" % (instance.getReference(), instance.getTitle(),
instance.getUrlString(), compute_node.getReference(),
compute_node.getAllocationScope()))
if instance.getPortalType() == "Software Instance" and \
compute_node.getAllocationScope() in ["closed/outdated"] and \
instance.getSlapState() == "start_requested" and \
instance.SoftwareInstance_hasReportedError():
message_list.append("%s on a %s compute_node" % (instance.getReference(), compute_node.getAllocationScope()) )
else:
message_list.append("%s is not allocated" % instance.getReference())
return ",".join(message_list)
......
......@@ -20,9 +20,5 @@ if scope == 'open/public':
return {"Auditor": ["R-SHADOW-PERSON"]}
elif scope == 'open/subscription':
return {"Auditor": ["R-SHADOW-PERSON"]}
elif scope == 'open/personal':
person = compute_node.getSourceAdministrationValue(portal_type="Person")
if person is not None:
return {"Auditor": ["SHADOW-%s" % person.getUserId()]}
return category_list
......@@ -28,7 +28,7 @@
.push(function (result) {
var i, value, value_jio_key, len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
if (result.data.rows[i].value.getAccessStatus) {
if (1 || (result.data.rows[i].value.getAccessStatus)) {
value = result.data.rows[i].value.getAccessStatus;
value_jio_key = result.data.rows[i].id;
result.data.rows[i].value.getAccessStatus = {
......@@ -101,14 +101,13 @@
"Closed for termination",
"Closed forever",
"Closed outdated",
"Open for Friends only", // Not used anymore
"Open",
"Open for Friends only",
"Open Public",
"Open for Subscribers only",
"Network",
"Allocation Scope",
"Monitoring",
"Your Friends email", // Not used anymore
"Your Friends email",
"Upgrade",
"The name of a document in ERP5",
"Current Site",
......@@ -163,23 +162,16 @@
[results[2][10], 'auto'],
[results[2][11], 'ask_confirmation'],
[results[2][12], 'never']],
supported_allocation_scope_list = ['',
'close/maintenance',
'close/termination',
'close/forever',
'close/outdated',
'close/noallocation',
'open/personal'],
allocation_scope_list = [['', ''],
[results[2][13], 'close/maintenance'],
[results[2][14], 'close/termination'],
[results[2][15], 'close/forever'],
[results[2][16], 'close/outdated'],
[results[2][33], 'close/noallocation'],
[results[2][18], 'open/personal']],
[results[2][17], 'open/friend'],
[results[2][18], 'open/public'],
[results[2][19], 'open/subscription']],
i,
hidden_allocation_scope = {'open/public': results[2][19],
'open/subscription': results[2][20]},
len = results[1].data.total_rows;
......@@ -190,16 +182,6 @@
]);
}
if (!supported_allocation_scope_list.includes(
gadget.state.doc.allocation_scope
) && (hidden_allocation_scope.hasOwnProperty(gadget.state.doc.allocation_scope))) {
allocation_scope_list.push(
[hidden_allocation_scope[gadget.state.doc.allocation_scope],
gadget.state.doc.allocation_scope
]
);
}
return form_gadget.render({
erp5_document: {
"_embedded": {"_view": {
......@@ -261,6 +243,17 @@
"hidden": 0,
"type": "ListField"
},
"my_subject_list": {
"description": "",
"title": results[2][24],
"default": gadget.state.doc.subject_list,
"css_class": "",
"required": 1,
"editable": 1,
"key": "subject_list",
"hidden": (gadget.state.doc.allocation_scope === "open/friend") ? 0 : 1,
"type": "LinesField"
},
"my_upgrade_scope": {
"description": "",
"title": results[2][25],
......@@ -367,7 +360,8 @@
], [
"right",
[["my_source"], ["my_source_project"], ["my_monitor_scope"],
["my_upgrade_scope"], ["my_allocation_scope"]]
["my_upgrade_scope"], ["my_allocation_scope"],
["my_subject_list"]]
], [
"bottom",
[["ticket_listbox"], ["listbox"]]
......
......@@ -100,11 +100,9 @@
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
......@@ -209,11 +207,9 @@
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
......@@ -267,7 +263,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1010.39762.20916.26709</string> </value>
<value> <string>998.18207.59213.64375</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -278,16 +274,14 @@
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1700505669.56</float>
<float>1652949235.86</float>
<string>UTC</string>
</tuple>
</state>
......@@ -341,11 +335,9 @@
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
......
portal = context.getPortalObject()
category_public = portal.restrictedTraverse("portal_categories/allocation_scope/open/public", None)
category_personal = portal.restrictedTraverse("portal_categories/allocation_scope/open/personal", None)
return portal.portal_catalog(
portal_type='Compute Node',
default_allocation_scope_uid=[
category_public.getUid(),
category_personal.getUid()],
],
validation_state="validated",
sort_on=(("title", "ASC" ),)
)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment