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
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
Thomas Gambier
erp5
Commits
32a12714
Commit
32a12714
authored
Aug 26, 2019
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused variables.
Cleanup conditional code.
parent
62ed554f
Changes
1
Show 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):
...
@@ -187,7 +187,6 @@ class SlapOSMasterCommunicator(object):
state
=
INSTANCE_STATE_UNKNOWN
state
=
INSTANCE_STATE_UNKNOWN
monitor_information_dict
=
{}
monitor_information_dict
=
{}
info_created_at
=
"-1"
is_slave
=
instance
[
'portal_type'
]
==
"Slave Instance"
is_slave
=
instance
[
'portal_type'
]
==
"Slave Instance"
if
is_slave
:
if
is_slave
:
if
len
(
instance
[
'getConnectionXmlAsDict'
])
>
0
:
if
len
(
instance
[
'getConnectionXmlAsDict'
])
>
0
:
...
@@ -196,24 +195,15 @@ class SlapOSMasterCommunicator(object):
...
@@ -196,24 +195,15 @@ class SlapOSMasterCommunicator(object):
# not slave
# not slave
instance_state
=
news
instance_state
=
news
if
instance_state
.
get
(
'created_at'
,
'-1'
)
!=
"-1"
:
if
instance_state
.
get
(
'created_at'
,
'-1'
)
!=
"-1"
:
# the following does NOT take TZ into account
instance_text
=
instance_state
[
'text'
]
created_at
=
datetime
.
datetime
.
strptime
(
instance_state
[
'created_at'
],
'%a, %d %b %Y %H:%M:%S %Z'
)
gmt_now
=
datetime
.
datetime
(
*
time
.
gmtime
()[:
6
])
info_created_at
=
'%s (%d)'
%
(
if
instance_text
.
startswith
(
'#access Instance correctly stopped'
):
instance_state
[
'created_at'
],
(
gmt_now
-
created_at
).
seconds
)
if
instance_state
[
'text'
].
startswith
(
'#access'
):
state
=
INSTANCE_STATE_STARTED
state
=
INSTANCE_STATE_STARTED
elif
instance_text
.
startswith
(
'#access'
):
if
instance_state
[
'text'
].
startswith
(
'#access Instance correctly stopped'
):
state
=
INSTANCE_STATE_STOPPED
state
=
INSTANCE_STATE_STOPPED
elif
instance_text
.
startswith
(
'#destroy'
):
if
instance_state
[
'text'
].
startswith
(
'#destroy'
):
state
=
INSTANCE_STATE_DESTROYED
state
=
INSTANCE_STATE_DESTROYED
elif
instance_text
.
startswith
(
'#error'
):
if
instance_state
[
'text'
].
startswith
(
'#error'
):
state
=
INSTANCE_STATE_STARTED_WITH_ERROR
state
=
INSTANCE_STATE_STARTED_WITH_ERROR
if
state
==
INSTANCE_STATE_STARTED_WITH_ERROR
:
if
state
==
INSTANCE_STATE_STARTED_WITH_ERROR
:
...
...
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