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
053ab26d
Commit
053ab26d
authored
Aug 12, 2021
by
Rafael Monnerat
👻
Browse files
Options
Browse Files
Download
Plain Diff
Update certificates as late as possible
See merge request
nexedi/slapos.core!324
parents
04c74cd1
8a3a0ed5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
slapos/grid/SlapObject.py
slapos/grid/SlapObject.py
+4
-1
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+6
-0
No files found.
slapos/grid/SlapObject.py
View file @
053ab26d
...
...
@@ -452,7 +452,6 @@ class Partition(object):
self
.
partition_id
+
'.key'
)
self
.
cert_file
=
os
.
path
.
join
(
certificate_repository_path
,
self
.
partition_id
+
'.crt'
)
self
.
_updateCertificate
()
try
:
self
.
retention_delay
=
float
(
retention_delay
)
...
...
@@ -485,6 +484,10 @@ class Partition(object):
required
=
bytes2human
(
required
)))
def
_updateCertificate
(
self
):
if
not
self
.
key_file
or
not
self
.
cert_file
:
# Certificate files are unset, skip.
return
try
:
partition_certificate
=
self
.
computer_partition
.
getCertificate
()
except
NotFoundError
:
...
...
slapos/grid/slapgrid.py
View file @
053ab26d
...
...
@@ -954,9 +954,11 @@ stderr_logfile_backups=1
except
PromiseError
as
e
:
self
.
logger
.
error
(
e
)
if
partition_access_status
is
None
or
not
status_error
:
local_partition
.
_updateCertificate
()
computer_partition
.
error
(
e
,
logger
=
self
.
logger
)
else
:
if
partition_access_status
is
None
or
status_error
:
local_partition
.
_updateCertificate
()
computer_partition
.
started
()
def
processPromise
(
self
,
computer_partition
):
...
...
@@ -1184,6 +1186,9 @@ stderr_logfile_backups=1
self
.
logger
.
info
(
' Software path: %s'
%
software_path
)
self
.
logger
.
info
(
' Instance path: %s'
%
instance_path
)
# Update certifcate at late as possible
local_partition
.
_updateCertificate
()
# XXX this line breaks 37 tests
# self.logger.info(' Instance type: %s' % computer_partition.getType())
self
.
logger
.
info
(
' Instance status: %s'
%
computer_partition_state
)
...
...
@@ -1788,6 +1793,7 @@ stderr_logfile_backups=1
ipv4_global_network
=
self
.
ipv4_global_network
,
)
local_partition
.
stop
()
local_partition
.
_updateCertificate
()
try
:
computer_partition
.
stopped
()
except
(
SystemExit
,
KeyboardInterrupt
):
...
...
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