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
Ophélie Gagnard
slapos.core
Commits
48141037
Commit
48141037
authored
Apr 06, 2018
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapgrid: write error_log file if exception is no a PromiseError
parent
4b147eae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+13
-12
No files found.
slapos/grid/slapgrid.py
View file @
48141037
...
@@ -1073,6 +1073,9 @@ stderr_logfile_backups=1
...
@@ -1073,6 +1073,9 @@ stderr_logfile_backups=1
# self.logger.info(' Instance type: %s' % computer_partition.getType())
# self.logger.info(' Instance type: %s' % computer_partition.getType())
self
.
logger
.
info
(
' Instance status: %s'
%
computer_partition_state
)
self
.
logger
.
info
(
' Instance status: %s'
%
computer_partition_state
)
if
os
.
path
.
exists
(
error_output_file
):
os
.
unlink
(
error_output_file
)
partition_ip_list
=
full_hosting_ip_list
=
[]
partition_ip_list
=
full_hosting_ip_list
=
[]
if
self
.
firewall_conf
:
if
self
.
firewall_conf
:
partition_ip_list
=
parameter_dict
[
'ip_list'
]
+
parameter_dict
.
get
(
partition_ip_list
=
parameter_dict
[
'ip_list'
]
+
parameter_dict
.
get
(
...
@@ -1121,11 +1124,11 @@ stderr_logfile_backups=1
...
@@ -1121,11 +1124,11 @@ stderr_logfile_backups=1
computer_partition
.
error
(
error_string
,
logger
=
self
.
logger
)
computer_partition
.
error
(
error_string
,
logger
=
self
.
logger
)
raise
NotImplementedError
(
error_string
)
raise
NotImplementedError
(
error_string
)
except
Exception
,
e
:
except
Exception
,
e
:
if
not
isinstance
(
e
,
PromiseError
):
with
open
(
error_output_file
,
'w'
)
as
error_file
:
with
open
(
error_output_file
,
'w'
)
as
error_file
:
# Write error message in a log file assible to computer partition user
# Write error message in a log file assible to computer partition user
error_file
.
write
(
str
(
e
))
error_file
.
write
(
str
(
e
))
if
not
isinstance
(
e
,
PromiseError
)
and
\
if
computer_partition_state
==
COMPUTER_PARTITION_STARTED_STATE
:
computer_partition_state
==
COMPUTER_PARTITION_STARTED_STATE
:
try
:
try
:
self
.
_checkPromiseList
(
local_partition
)
self
.
_checkPromiseList
(
local_partition
)
except
PromiseError
:
except
PromiseError
:
...
@@ -1134,8 +1137,6 @@ stderr_logfile_backups=1
...
@@ -1134,8 +1137,6 @@ stderr_logfile_backups=1
raise
e
raise
e
else
:
else
:
self
.
logger
.
removeHandler
(
partition_file_handler
)
self
.
logger
.
removeHandler
(
partition_file_handler
)
if
os
.
path
.
exists
(
error_output_file
):
os
.
unlink
(
error_output_file
)
# If partition has been successfully processed, write timestamp
# If partition has been successfully processed, write timestamp
if
timestamp
:
if
timestamp
:
...
...
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