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
Jérome Perrin
slapos.core
Commits
b790643e
Commit
b790643e
authored
Mar 09, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py3: 2to3 -j 20 --write --nobackups --no-diffs --fix=has_key master
parent
e5fd9154
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
19 additions
and
19 deletions
+19
-19
master/bt5/slapos_abyss/SkinTemplateItem/portal_skins/slapos_abyss/DataArray_getArrayFileInfoList.py
...rtal_skins/slapos_abyss/DataArray_getArrayFileInfoList.py
+1
-1
master/bt5/slapos_cloud/MixinTemplateItem/portal_components/mixin.erp5.SlapOSComputeNodeMixin.py
...em/portal_components/mixin.erp5.SlapOSComputeNodeMixin.py
+2
-2
master/bt5/slapos_cloud/MixinTemplateItem/portal_components/mixin.erp5.SlapOSComputePartitionMixin.py
...rtal_components/mixin.erp5.SlapOSComputePartitionMixin.py
+2
-2
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/ComputeNode_hasContactedRecently.py
...slapos_crm_monitoring/ComputeNode_hasContactedRecently.py
+1
-1
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/InstanceTree_getMonitorParameterDict.py
...os_hal_json_style/InstanceTree_getMonitorParameterDict.py
+3
-3
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Login_edit.py
...lateItem/portal_skins/slapos_hal_json_style/Login_edit.py
+1
-1
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
...ortal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
+6
-6
master/bt5/slapos_slap_tool/SkinTemplateItem/portal_skins/slapos_slap_tool/ComputeNode_updateFromDict.py
...rtal_skins/slapos_slap_tool/ComputeNode_updateFromDict.py
+2
-2
master/product/SlapOS/tests/testSlapOSMixin.py
master/product/SlapOS/tests/testSlapOSMixin.py
+1
-1
No files found.
master/bt5/slapos_abyss/SkinTemplateItem/portal_skins/slapos_abyss/DataArray_getArrayFileInfoList.py
View file @
b790643e
...
@@ -44,7 +44,7 @@ length = context.getArrayShape()[0]
...
@@ -44,7 +44,7 @@ length = context.getArrayShape()[0]
# never access more than 1000 lines at once
# never access more than 1000 lines at once
list_lines
=
min
(
list_lines
,
limit
,
1000
)
list_lines
=
min
(
list_lines
,
limit
,
1000
)
if
context
.
REQUEST
.
has_key
(
"limit"
)
:
if
"limit"
in
context
.
REQUEST
:
list_start
=
limit
[
0
]
list_start
=
limit
[
0
]
list_lines
=
limit
[
1
]
-
limit
[
0
]
list_lines
=
limit
[
1
]
-
limit
[
0
]
...
...
master/bt5/slapos_cloud/MixinTemplateItem/portal_components/mixin.erp5.SlapOSComputeNodeMixin.py
View file @
b790643e
...
@@ -308,10 +308,10 @@ class SlapOSComputeNodeMixin(object):
...
@@ -308,10 +308,10 @@ class SlapOSComputeNodeMixin(object):
parameter_dict
.
pop
(
'filter_xml'
))
parameter_dict
.
pop
(
'filter_xml'
))
partition_dict
[
'_instance_guid'
]
=
parameter_dict
.
pop
(
'instance_guid'
)
partition_dict
[
'_instance_guid'
]
=
parameter_dict
.
pop
(
'instance_guid'
)
for
slave_instance_dict
in
parameter_dict
.
get
(
"slave_instance_list"
,
[]):
for
slave_instance_dict
in
parameter_dict
.
get
(
"slave_instance_list"
,
[]):
if
slave_instance_dict
.
has_key
(
"connection_xml"
)
:
if
"connection_xml"
in
slave_instance_dict
:
slave_instance_dict
.
update
(
self
.
_instanceXmlToDict
(
slave_instance_dict
.
update
(
self
.
_instanceXmlToDict
(
slave_instance_dict
.
pop
(
"connection_xml"
)))
slave_instance_dict
.
pop
(
"connection_xml"
)))
if
slave_instance_dict
.
has_key
(
"xml"
)
:
if
"xml"
in
slave_instance_dict
:
slave_instance_dict
.
update
(
self
.
_instanceXmlToDict
(
slave_instance_dict
.
update
(
self
.
_instanceXmlToDict
(
slave_instance_dict
.
pop
(
"xml"
)))
slave_instance_dict
.
pop
(
"xml"
)))
partition_dict
[
'_parameter_dict'
].
update
(
parameter_dict
)
partition_dict
[
'_parameter_dict'
].
update
(
parameter_dict
)
...
...
master/bt5/slapos_cloud/MixinTemplateItem/portal_components/mixin.erp5.SlapOSComputePartitionMixin.py
View file @
b790643e
...
@@ -129,13 +129,13 @@ class SlapOSComputePartitionMixin(object):
...
@@ -129,13 +129,13 @@ class SlapOSComputePartitionMixin(object):
parameter_dict
.
pop
(
'filter_xml'
))
parameter_dict
.
pop
(
'filter_xml'
))
partition_dict
[
'_instance_guid'
]
=
parameter_dict
.
pop
(
'instance_guid'
)
partition_dict
[
'_instance_guid'
]
=
parameter_dict
.
pop
(
'instance_guid'
)
for
slave_instance_dict
in
parameter_dict
.
get
(
"slave_instance_list"
,
[]):
for
slave_instance_dict
in
parameter_dict
.
get
(
"slave_instance_list"
,
[]):
if
slave_instance_dict
.
has_key
(
"connection_xml"
)
:
if
"connection_xml"
in
slave_instance_dict
:
connection_dict
=
software_instance
.
_instanceXmlToDict
(
connection_dict
=
software_instance
.
_instanceXmlToDict
(
slave_instance_dict
.
pop
(
"connection_xml"
))
slave_instance_dict
.
pop
(
"connection_xml"
))
slave_instance_dict
.
update
(
connection_dict
)
slave_instance_dict
.
update
(
connection_dict
)
slave_instance_dict
[
'connection-parameter-hash'
]
=
\
slave_instance_dict
[
'connection-parameter-hash'
]
=
\
calculate_dict_hash
(
connection_dict
)
calculate_dict_hash
(
connection_dict
)
if
slave_instance_dict
.
has_key
(
"xml"
)
:
if
"xml"
in
slave_instance_dict
:
slave_instance_dict
.
update
(
software_instance
.
_instanceXmlToDict
(
slave_instance_dict
.
update
(
software_instance
.
_instanceXmlToDict
(
slave_instance_dict
.
pop
(
"xml"
)))
slave_instance_dict
.
pop
(
"xml"
)))
partition_dict
[
'_parameter_dict'
].
update
(
parameter_dict
)
partition_dict
[
'_parameter_dict'
].
update
(
parameter_dict
)
...
...
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/ComputeNode_hasContactedRecently.py
View file @
b790643e
...
@@ -11,7 +11,7 @@ message_dict = context.getAccessStatus()
...
@@ -11,7 +11,7 @@ message_dict = context.getAccessStatus()
if
message_dict
.
get
(
"no_data"
,
None
)
==
1
:
if
message_dict
.
get
(
"no_data"
,
None
)
==
1
:
message_dict
=
{}
message_dict
=
{}
if
message_dict
.
has_key
(
'created_at'
)
:
if
'created_at'
in
message_dict
:
contact_date
=
DateTime
(
message_dict
.
get
(
'created_at'
).
encode
(
'utf-8'
))
contact_date
=
DateTime
(
message_dict
.
get
(
'created_at'
).
encode
(
'utf-8'
))
return
(
now_date
-
contact_date
)
<
maximum_days
return
(
now_date
-
contact_date
)
<
maximum_days
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/InstanceTree_getMonitorParameterDict.py
View file @
b790643e
...
@@ -29,9 +29,9 @@ parameter_dict = instance.getConnectionXmlAsDict()
...
@@ -29,9 +29,9 @@ parameter_dict = instance.getConnectionXmlAsDict()
url_string
=
parameter_dict
.
get
(
'monitor-setup-url'
,
''
)
url_string
=
parameter_dict
.
get
(
'monitor-setup-url'
,
''
)
if
url_string
:
if
url_string
:
if
parameter_dict
.
has_key
(
'monitor-user'
)
and
\
if
'monitor-user'
in
parameter_dict
and
\
parameter_dict
.
has_key
(
'monitor-password'
)
and
\
'monitor-password'
in
parameter_dict
and
\
parameter_dict
.
has_key
(
'monitor-base-url'
)
:
'monitor-base-url'
in
parameter_dict
:
username
=
parameter_dict
.
get
(
'monitor-user'
)
username
=
parameter_dict
.
get
(
'monitor-user'
)
password
=
parameter_dict
.
get
(
'monitor-password'
)
password
=
parameter_dict
.
get
(
'monitor-password'
)
url
=
parameter_dict
.
get
(
'monitor-base-url'
)
+
'/public/feeds'
url
=
parameter_dict
.
get
(
'monitor-base-url'
)
+
'/public/feeds'
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Login_edit.py
View file @
b790643e
...
@@ -26,7 +26,7 @@ current_username = context.getPortalObject().portal_membership.getAuthenticatedM
...
@@ -26,7 +26,7 @@ current_username = context.getPortalObject().portal_membership.getAuthenticatedM
if
current_username
==
original_login
:
if
current_username
==
original_login
:
# We should logout immediately
# We should logout immediately
if
context
.
REQUEST
.
has_key
(
'portal_skin'
)
:
if
'portal_skin'
in
context
.
REQUEST
:
context
.
portal_skins
.
clearSkinCookie
()
context
.
portal_skins
.
clearSkinCookie
()
context
.
REQUEST
.
RESPONSE
.
expireCookie
(
'__ac'
,
path
=
'/'
)
context
.
REQUEST
.
RESPONSE
.
expireCookie
(
'__ac'
,
path
=
'/'
)
context
.
REQUEST
.
RESPONSE
.
expireCookie
(
'__ac_google_hash'
,
path
=
'/'
)
context
.
REQUEST
.
RESPONSE
.
expireCookie
(
'__ac_google_hash'
,
path
=
'/'
)
...
...
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
View file @
b790643e
...
@@ -46,9 +46,9 @@ class TestSlapOSHalJsonStyleMixin(SlapOSTestCaseMixinWithAbort):
...
@@ -46,9 +46,9 @@ class TestSlapOSHalJsonStyleMixin(SlapOSTestCaseMixinWithAbort):
return
''
return
''
if
context
.
getPortalType
()
in
[
"Software Instance"
,
"Slave Instance"
]:
if
context
.
getPortalType
()
in
[
"Software Instance"
,
"Slave Instance"
]:
connection
=
context
.
getConnectionXmlAsDict
()
connection
=
context
.
getConnectionXmlAsDict
()
if
connection
and
connection
.
has_key
(
'monitor-user'
)
and
\
if
connection
and
'monitor-user'
in
connection
and
\
connection
.
has_key
(
'monitor-password'
)
and
\
'monitor-password'
in
connection
and
\
connection
.
has_key
(
'monitor-base-url'
)
:
'monitor-base-url'
in
connection
:
return
'https://monitor.app.officejs.com/#/?username=testuser&url=softinst-monitored/public/feeds&password=testpass&page=ojsm_dispatch&query=portal_type%3A%22Software%20Instance%22%20AND%20title%3A%22Template%20Software%20Instance%22%20AND%20specialise_title%3A%22Template%20Instance%20Tree%22'
return
'https://monitor.app.officejs.com/#/?username=testuser&url=softinst-monitored/public/feeds&password=testpass&page=ojsm_dispatch&query=portal_type%3A%22Software%20Instance%22%20AND%20title%3A%22Template%20Software%20Instance%22%20AND%20specialise_title%3A%22Template%20Instance%20Tree%22'
else
:
else
:
return
''
return
''
...
@@ -56,9 +56,9 @@ class TestSlapOSHalJsonStyleMixin(SlapOSTestCaseMixinWithAbort):
...
@@ -56,9 +56,9 @@ class TestSlapOSHalJsonStyleMixin(SlapOSTestCaseMixinWithAbort):
soft_inst
=
context
.
getSuccessorValue
()
soft_inst
=
context
.
getSuccessorValue
()
if
soft_inst
:
if
soft_inst
:
connection
=
soft_inst
.
getConnectionXmlAsDict
()
connection
=
soft_inst
.
getConnectionXmlAsDict
()
if
connection
and
connection
.
has_key
(
'monitor-user'
)
and
\
if
connection
and
'monitor-user'
in
connection
and
\
connection
.
has_key
(
'monitor-password'
)
and
\
'monitor-password'
in
connection
and
\
connection
.
has_key
(
'monitor-base-url'
)
:
'monitor-base-url'
in
connection
:
return
'https://monitor.app.officejs.com/#/?username=testuser&url=softinst-monitored/public/feeds&password=testpass&page=ojsm_dispatch&query=portal_type%3A%22Instance%20Tree%22%20AND%20title%3A%22Template%20Instance%20Tree%22'
return
'https://monitor.app.officejs.com/#/?username=testuser&url=softinst-monitored/public/feeds&password=testpass&page=ojsm_dispatch&query=portal_type%3A%22Instance%20Tree%22%20AND%20title%3A%22Template%20Instance%20Tree%22'
return
''
return
''
...
...
master/bt5/slapos_slap_tool/SkinTemplateItem/portal_skins/slapos_slap_tool/ComputeNode_updateFromDict.py
View file @
b790643e
...
@@ -14,7 +14,7 @@ def compareAndUpdateAddressList(document, address_list, additional_dict=None):
...
@@ -14,7 +14,7 @@ def compareAndUpdateAddressList(document, address_list, additional_dict=None):
to_add_ip_dict_list
.
remove
(
current_dict
)
to_add_ip_dict_list
.
remove
(
current_dict
)
else
:
else
:
# XXX - Only delete if Network interface are supposed to be the same
# XXX - Only delete if Network interface are supposed to be the same
if
additional_dict
.
has_key
(
'network_interface'
)
:
if
'network_interface'
in
additional_dict
:
if
address
.
getNetworkInterface
(
''
)
and
additional_dict
[
'network_interface'
]
!=
address
.
getNetworkInterface
():
if
address
.
getNetworkInterface
(
''
)
and
additional_dict
[
'network_interface'
]
!=
address
.
getNetworkInterface
():
continue
continue
to_delete_ip_id_list
.
append
(
address
.
getId
())
to_delete_ip_id_list
.
append
(
address
.
getId
())
...
@@ -94,7 +94,7 @@ for send_partition in compute_node_dict['partition_list']:
...
@@ -94,7 +94,7 @@ for send_partition in compute_node_dict['partition_list']:
compareAndUpdateAddressList
(
partition
,
send_partition
[
'address_list'
],
{
'network_interface'
:
network_interface
})
compareAndUpdateAddressList
(
partition
,
send_partition
[
'address_list'
],
{
'network_interface'
:
network_interface
})
tap_addr_list
=
[]
tap_addr_list
=
[]
additional_dict
=
{
'network_interface'
:
'route_'
+
network_interface
}
additional_dict
=
{
'network_interface'
:
'route_'
+
network_interface
}
if
send_partition
[
'tap'
].
has_key
(
'ipv4_addr'
)
and
send_partition
[
'tap'
][
'ipv4_addr'
]:
if
'ipv4_addr'
in
send_partition
[
'tap'
]
and
send_partition
[
'tap'
][
'ipv4_addr'
]:
tap_addr_list
.
append
({
tap_addr_list
.
append
({
'addr'
:
send_partition
[
'tap'
][
'ipv4_addr'
],
'addr'
:
send_partition
[
'tap'
][
'ipv4_addr'
],
'netmask'
:
send_partition
[
'tap'
][
'ipv4_netmask'
]
'netmask'
:
send_partition
[
'tap'
][
'ipv4_netmask'
]
...
...
master/product/SlapOS/tests/testSlapOSMixin.py
View file @
b790643e
...
@@ -128,7 +128,7 @@ class testSlapOSMixin(ERP5TypeTestCase):
...
@@ -128,7 +128,7 @@ class testSlapOSMixin(ERP5TypeTestCase):
def
isLiveTest
(
self
):
def
isLiveTest
(
self
):
#return 'ERP5TypeLiveTestCase' in [q.__name__ for q in self.__class__.mro()]
#return 'ERP5TypeLiveTestCase' in [q.__name__ for q in self.__class__.mro()]
# XXX - What is the better way to know if we are in live test mode ?
# XXX - What is the better way to know if we are in live test mode ?
return
not
os
.
environ
.
has_key
(
'TEST_CA_PATH'
)
return
'TEST_CA_PATH'
not
in
os
.
environ
def
beforeTearDown
(
self
):
def
beforeTearDown
(
self
):
if
self
.
abort_transaction
:
if
self
.
abort_transaction
:
...
...
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