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
Roque
slapos.core
Commits
2c6ba47c
Commit
2c6ba47c
authored
Mar 01, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
master: use print as a function
parent
84dd197b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
14 deletions
+14
-14
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/ERP5Site_cleanUnusedSecurityUid.py
.../slapos_administration/ERP5Site_cleanUnusedSecurityUid.py
+9
-9
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/ERP5Site_dumpWebPageModuleContent.py
...lapos_administration/ERP5Site_dumpWebPageModuleContent.py
+1
-1
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/ERP5Site_getSecurityUidStat.py
...kins/slapos_administration/ERP5Site_getSecurityUidStat.py
+3
-3
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/ERP5Site_updateAllLocalRolesOnSecurityGroupsForSlapOS.py
.../ERP5Site_updateAllLocalRolesOnSecurityGroupsForSlapOS.py
+1
-1
No files found.
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/ERP5Site_cleanUnusedSecurityUid.py
View file @
2c6ba47c
...
...
@@ -58,9 +58,9 @@ for group, reverse_security_uid_dict in reverse_group_security_uid_dict.iteritem
used_security_uid_set
=
used_group_security_uid_dict
[
group
]
unused_security_uid_set
=
set
(
reverse_security_uid_dict
).
difference
(
used_security_uid_set
)
if
unused_security_uid_set
:
print
'# Will delete'
,
len
(
unused_security_uid_set
),
'security_uids in group'
,
repr
(
group
)
print
(
'# Will delete'
,
len
(
unused_security_uid_set
),
'security_uids in group'
,
repr
(
group
)
)
for
unused_security_uid
in
unused_security_uid_set
:
print
' * '
,
unused_security_uid
,
reverse_security_uid_dict
[
unused_security_uid
]
print
(
' * '
,
unused_security_uid
,
reverse_security_uid_dict
[
unused_security_uid
])
delitem
((
group
,
reverse_security_uid_dict
[
unused_security_uid
]))
portal
.
z_delete_security_uid_set_from_roles_and_users
(
uid
=
unused_security_uid
)
...
...
@@ -68,25 +68,25 @@ for group, reverse_security_uid_dict in reverse_group_security_uid_dict.iteritem
cataloged_security_uid_set
=
set
([
x
.
uid
for
x
in
portal
.
z_get_uid_group_from_roles_and_users
()])
existing_security_uid_set
=
set
(
dict
(
security_uid_dict
).
values
())
print
'# Catalog secuirity_uid count'
,
len
(
cataloged_security_uid_set
)
print
'# ZODB secuirity_uid count'
,
len
(
existing_security_uid_set
)
print
(
'# Catalog secuirity_uid count'
,
len
(
cataloged_security_uid_set
)
)
print
(
'# ZODB secuirity_uid count'
,
len
(
existing_security_uid_set
)
)
not_existing_security_uid_set
=
existing_security_uid_set
.
difference
(
cataloged_security_uid_set
)
print
'# Not catalogued'
,
len
(
not_existing_security_uid_set
),
'security_uid'
print
(
'# Not catalogued'
,
len
(
not_existing_security_uid_set
),
'security_uid'
)
for
security_uid
in
not_existing_security_uid_set
:
print
' * '
,
security_uid
,
reverse_groupless_security_uid_dict
[
security_uid
]
print
(
' * '
,
security_uid
,
reverse_groupless_security_uid_dict
[
security_uid
])
not_existing_security_uid_set
=
cataloged_security_uid_set
.
difference
(
existing_security_uid_set
)
if
not_existing_security_uid_set
:
print
'# Will uncatalog'
,
len
(
not_existing_security_uid_set
),
'security_uid'
print
' * like: '
,
list
(
not_existing_security_uid_set
)[:
10
]
print
(
'# Will uncatalog'
,
len
(
not_existing_security_uid_set
),
'security_uid'
)
print
(
' * like: '
,
list
(
not_existing_security_uid_set
)[:
10
])
for
security_uid
in
not_existing_security_uid_set
:
assert
security_uid
not
in
reverse_groupless_security_uid_dict
portal
.
z_delete_security_uid_set_from_roles_and_users
(
security_uid
=
security_uid
)
if
0
:
print
'DRY'
print
(
'DRY'
)
context
.
REQUEST
.
RESPONSE
.
write
(
printed
)
raise
Exception
(
'dry'
)
return
printed
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/ERP5Site_dumpWebPageModuleContent.py
View file @
2c6ba47c
...
...
@@ -28,7 +28,7 @@ for document in portal.web_page_module.searchFolder(
break
if
print_web_content
:
print
getWebContentHash
(
document
)
print
(
getWebContentHash
(
document
)
)
container
.
REQUEST
.
RESPONSE
.
setHeader
(
'content-type'
,
'text/plain'
)
return
'
\
n
'
.
join
(
sorted
(
printed
.
splitlines
()))
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/ERP5Site_getSecurityUidStat.py
View file @
2c6ba47c
...
...
@@ -22,10 +22,10 @@ for user_id in sorted(user_id_list):
info_list
.
append
(
info
)
print
','
.
join
([
'user_id'
,
'group_count'
,]
+
[
x
[
1
]
for
x
in
uid_groups_columns_items
])
print
(
','
.
join
([
'user_id'
,
'group_count'
,]
+
[
x
[
1
]
for
x
in
uid_groups_columns_items
])
)
for
info
in
info_list
:
print
','
.
join
([
str
(
x
)
for
x
in
info
]
)
print
(
','
.
join
([
str
(
x
)
for
x
in
info
])
)
response
=
portal
.
REQUEST
.
RESPONSE
response
.
setHeader
(
'Content-Disposition'
,
'attachement;filename=%s-%s.csv'
%
(
script
.
getId
(),
DateTime
().
strftime
(
'%Y%m%d'
)))
...
...
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/ERP5Site_updateAllLocalRolesOnSecurityGroupsForSlapOS.py
View file @
2c6ba47c
...
...
@@ -4,7 +4,7 @@ portal = context.getPortalObject()
for
portal_type
in
(
"Access Token Module"
,
"Account Module"
,
"Account"
,
"Accounting Period"
,
"Accounting Transaction Module"
,
"Accounting Transaction"
,
"Acknowledgement"
,
"Assignment"
,
"Balance Transaction"
,
"Bank Account"
,
"Compute Node"
,
"Compute Partition"
,
"Business Process Module"
,
"Business Process"
,
"Campaign Module"
,
"Campaign"
,
"Cash Register"
,
"Cloud Contract Module"
,
"Cloud Contract"
,
"Component Module"
,
"Component"
,
"Computer Consumption TioXML File"
,
"Computer Model Module"
,
"Computer Model"
,
"Compute Node Module"
,
"Computer Network Module"
,
"Computer Network"
,
"Consumption Document Module"
,
"Contribution Tool"
,
"Credential Update Module"
,
"Credit Card"
,
"Currency Module"
,
"Currency"
,
"Data Set Module"
,
"Data Set"
,
"Document Ingestion Module"
,
"Document Module"
,
"Drawing"
,
"Event Module"
,
"Fax Message"
,
"File"
,
"Gadget Tool"
,
"Gadget"
,
"Instance Tree Module"
,
"Instance Tree"
,
"Image Module"
,
"Image"
,
"Integration Site"
,
"Integration Tool"
,
"Inventory Module"
,
"Inventory"
,
"Knowledge Box"
,
"Knowledge Pad Module"
,
"Knowledge Pad"
,
"Letter"
,
"Mail Message"
,
"Meeting Module"
,
"Meeting"
,
"Note"
,
"Notification Message Module"
,
"Notification Message"
,
"One Time Restricted Access Token"
,
"Open Sale Order Module"
,
"Open Sale Order"
,
"Organisation Module"
,
"Organisation"
,
"PDF"
,
"Payment Transaction"
,
"Payzen Event"
,
"Person Module"
,
"Person"
,
"Phone Call"
,
"Presentation"
,
"Product Module"
,
"Product"
,
"Project Module"
,
"Project"
,
"Purchase Invoice Transaction"
,
"Purchase Order Module"
,
"Purchase Order"
,
"Purchase Trade Condition Module"
,
"Purchase Trade Condition"
,
"Query Module"
,
"Query"
,
"Regularisation Request Module"
,
"Regularisation Request"
,
"Restricted Access Token"
,
"Sale Invoice Transaction"
,
"Sale Opportunity Module"
,
"Sale Opportunity"
,
"Sale Order Module"
,
"Sale Order"
,
"Sale Packing List Module"
,
"Sale Trade Condition Module"
,
"Sale Trade Condition"
,
"Service Module"
,
"Service"
,
"Short Message"
,
"Site Message"
,
"Slave Instance"
,
"Software Installation Module"
,
"Software Installation"
,
"Software Instance Module"
,
"Software Instance"
,
"Software Product Module"
,
"Software Product"
,
"Software Release Module"
,
"Software Release"
,
"Spreadsheet"
,
"Support Request Module"
,
"Support Request"
,
"System Event Module"
,
"Text"
,
"Transformation Module"
,
"Transformation"
,
"Upgrade Decision Module"
,
"Upgrade Decision"
,
"User Consumption HTML File"
,
"Visit"
,
"Web Message"
,
"Web Page Module"
,
"Web Page"
):
print
portal_type
print
(
portal_type
)
portal
.
portal_types
[
portal_type
].
updateRoleMapping
(
priority
=
4
)
context
.
portal_catalog
.
searchAndActivate
(
...
...
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