Parcourir la source

Wamp registration rpc returns the configuration.

if the board is already registered the wamp rpc returns
the board config instead of rejects the request,

Change-Id: Id23f558d7598d44d69effc929d07bdc25ae90e45
tags/0.4.7
Fabio Verboso il y a 1 an
Parent
révision
175653d8aa
1 fichiers modifiés avec 10 ajouts et 6 suppressions
  1. +10
    -6
      iotronic/conductor/endpoints.py

+ 10
- 6
iotronic/conductor/endpoints.py Voir le fichier

@@ -130,12 +130,6 @@ class ConductorEndpoint(object):
LOG.error(msg)
return wm.WampError(msg).serialize()

if not board.status == states.REGISTERED:
msg = "board with code %(board)s cannot " \
"be registered again." % {'board': code}
LOG.error(msg)
return wm.WampError(msg).serialize()

try:
old_ses = objects.SessionWP(ctx)
old_ses = old_ses.get_session_by_board_uuid(ctx, board.uuid,
@@ -152,6 +146,16 @@ class ConductorEndpoint(object):
session = objects.SessionWP(ctx, **session_data)
session.create()

if not board.status == states.REGISTERED:
msg = "board with code %(board)s " \
"already registered" % {'board': code}
LOG.warning((msg))
board.status = states.OFFLINE
board.save()
LOG.debug('sending this conf %s', board.config)
wmessage = wm.WampSuccess(board.config)
return wmessage.serialize()

board.agent = get_best_agent(ctx)
agent = objects.WampAgent.get_by_hostname(ctx, board.agent)



Chargement…
Annuler
Enregistrer