Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cc-node
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
cc-node
Commits
eb1db518
Commit
eb1db518
authored
14 years ago
by
Benziane Chakib
Browse files
Options
Downloads
Patches
Plain Diff
bug fix when authenticating and validating login in the server
parent
62d24f17
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/cc-node
+6
-10
6 additions, 10 deletions
bin/cc-node
with
6 additions
and
10 deletions
bin/cc-node
+
6
−
10
View file @
eb1db518
...
...
@@ -10,7 +10,6 @@ import logging
import
logging.handlers
import
signal
import
threading
import
socket
from
time
import
sleep
from
math
import
exp
...
...
@@ -26,7 +25,7 @@ DEFAULT_CONFIG_FILE = '/etc/cc-node.conf'
DEFAULT_PID_FILE
=
'
/var/run/cc-node.pid
'
DEFAULT_CONFIGURATION
=
{
'
address
'
:
None
,
'
login
'
:
'
$HOSTNAME
'
,
'
login
'
:
None
,
'
password
'
:
None
,
'
port
'
:
1984
,
'
verbosity
'
:
0
,
...
...
@@ -68,19 +67,16 @@ def run_node(options):
def
authentication
():
timeout
=
1
login
=
options
[
'
login
'
].
replace
(
'
$HOSTNAME
'
,
socket
.
gethostname
())
while
node
.
manager
.
is_running
():
try
:
node
.
authentify
(
login
,
options
[
'
password
'
])
except
RpcError
as
error
:
logging
.
critical
(
'
Authentication error: %s
'
%
error
)
sleep
(
2
)
result
=
node
.
authentify
(
options
[
'
login
'
],
options
[
'
password
'
])
if
result
:
logging
.
info
(
'
Authentication suscessfull.
'
)
return
else
:
timeout
+=
0.1
print
exp
(
timeout
)
sleep
(
exp
(
timeout
))
logging
.
info
(
'
Authenticated to server
'
)
break
def
shutdown_handler
(
signum
,
frame
):
'''
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment