Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
137
Merge Requests
137
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
32a12714
Commit
32a12714
authored
5 years ago
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused variables.
Cleanup conditional code.
parent
62ed554f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
15 deletions
+5
-15
erp5/util/testnode/SlapOSMasterCommunicator.py
erp5/util/testnode/SlapOSMasterCommunicator.py
+5
-15
No files found.
erp5/util/testnode/SlapOSMasterCommunicator.py
View file @
32a12714
...
...
@@ -187,7 +187,6 @@ class SlapOSMasterCommunicator(object):
state
=
INSTANCE_STATE_UNKNOWN
monitor_information_dict
=
{}
info_created_at
=
"-1"
is_slave
=
instance
[
'portal_type'
]
==
"Slave Instance"
if
is_slave
:
if
len
(
instance
[
'getConnectionXmlAsDict'
])
>
0
:
...
...
@@ -196,24 +195,15 @@ class SlapOSMasterCommunicator(object):
# not slave
instance_state
=
news
if
instance_state
.
get
(
'created_at'
,
'-1'
)
!=
"-1"
:
# the following does NOT take TZ into account
created_at
=
datetime
.
datetime
.
strptime
(
instance_state
[
'created_at'
],
'%a, %d %b %Y %H:%M:%S %Z'
)
gmt_now
=
datetime
.
datetime
(
*
time
.
gmtime
()[:
6
])
instance_text
=
instance_state
[
'text'
]
info_created_at
=
'%s (%d)'
%
(
instance_state
[
'created_at'
],
(
gmt_now
-
created_at
).
seconds
)
if
instance_state
[
'text'
].
startswith
(
'#access'
):
if
instance_text
.
startswith
(
'#access Instance correctly stopped'
):
state
=
INSTANCE_STATE_STARTED
if
instance_state
[
'text'
].
startswith
(
'#access Instance correctly stopped'
):
elif
instance_text
.
startswith
(
'#access'
):
state
=
INSTANCE_STATE_STOPPED
if
instance_state
[
'text'
].
startswith
(
'#destroy'
):
elif
instance_text
.
startswith
(
'#destroy'
):
state
=
INSTANCE_STATE_DESTROYED
if
instance_state
[
'text'
].
startswith
(
'#error'
):
elif
instance_text
.
startswith
(
'#error'
):
state
=
INSTANCE_STATE_STARTED_WITH_ERROR
if
state
==
INSTANCE_STATE_STARTED_WITH_ERROR
:
...
...
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