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
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
Paul Graydon
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 -*-
# -*- coding: utf-8 -*-
import
httplib
import
logging
import
logging
import
json
import
json
import
os
import
os
...
@@ -93,9 +92,6 @@ def requestRemoveToken(client, token_base_path):
...
@@ -93,9 +92,6 @@ def requestRemoveToken(client, token_base_path):
reference
=
reference_key
.
split
(
'.'
)[
0
]
reference
=
reference_key
.
split
(
'.'
)[
0
]
try
:
try
:
result
=
client
.
deleteToken
(
token
)
result
=
client
.
deleteToken
(
token
)
except
httplib
.
NOT_FOUND
:
# Token is alread removed.
result
=
True
except
Exception
:
except
Exception
:
log
.
debug
(
'Request delete token fail for %s...
\
n
%s'
%
(
request_file
,
log
.
debug
(
'Request delete token fail for %s...
\
n
%s'
%
(
request_file
,
traceback
.
format_exc
()))
traceback
.
format_exc
()))
...
@@ -119,7 +115,7 @@ def requestRemoveToken(client, token_base_path):
...
@@ -119,7 +115,7 @@ def requestRemoveToken(client, token_base_path):
os
.
unlink
(
ipv6_file
)
os
.
unlink
(
ipv6_file
)
else
:
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
):
def
checkService
(
client
,
token_base_path
,
token_json
,
computer_partition
):
token_dict
=
loadJsonFile
(
token_json
)
token_dict
=
loadJsonFile
(
token_json
)
...
@@ -128,7 +124,7 @@ def checkService(client, token_base_path, token_json, computer_partition):
...
@@ -128,7 +124,7 @@ def checkService(client, token_base_path, token_json, computer_partition):
return
return
# Check token status
# 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
))
log
.
info
(
"%s %s"
%
(
slave_reference
,
token
))
status_file
=
os
.
path
.
join
(
token_base_path
,
'%s.status'
%
slave_reference
)
status_file
=
os
.
path
.
join
(
token_base_path
,
'%s.status'
%
slave_reference
)
if
not
os
.
path
.
exists
(
status_file
):
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