Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
104
Merge Requests
104
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
9f0b1c97
Commit
9f0b1c97
authored
Oct 02, 2024
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos.cookbook: re6stManageToken supports python3
it seems the RPC deleteToken never returned NOT_FOUND anyway.
parent
ebbbfe17
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
slapos/recipe/re6stnet/re6stnet.py
slapos/recipe/re6stnet/re6stnet.py
+2
-6
No files found.
slapos/recipe/re6stnet/re6stnet.py
View file @
9f0b1c97
# -*- coding: utf-8 -*-
import
httplib
import
logging
import
json
import
os
...
...
@@ -93,9 +92,6 @@ def requestRemoveToken(client, token_base_path):
reference
=
reference_key
.
split
(
'.'
)[
0
]
try
:
result
=
client
.
deleteToken
(
token
)
except
httplib
.
NOT_FOUND
:
# Token is alread removed.
result
=
True
except
Exception
:
log
.
debug
(
'Request delete token fail for %s...
\
n
%s'
%
(
request_file
,
traceback
.
format_exc
()))
...
...
@@ -119,7 +115,7 @@ def requestRemoveToken(client, token_base_path):
os
.
unlink
(
ipv6_file
)
else
:
log
.
debug
(
'Bad token. Request
add
token fail for %s...'
%
request_file
)
log
.
debug
(
'Bad token. Request
remove
token fail for %s...'
%
request_file
)
def
checkService
(
client
,
token_base_path
,
token_json
,
computer_partition
):
token_dict
=
loadJsonFile
(
token_json
)
...
...
@@ -128,7 +124,7 @@ def checkService(client, token_base_path, token_json, computer_partition):
return
# Check token status
for
slave_reference
,
token
in
token_dict
.
ite
rite
ms
():
for
slave_reference
,
token
in
token_dict
.
items
():
log
.
info
(
"%s %s"
%
(
slave_reference
,
token
))
status_file
=
os
.
path
.
join
(
token_base_path
,
'%s.status'
%
slave_reference
)
if
not
os
.
path
.
exists
(
status_file
):
...
...
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