Hi all,
I wrote a patch to the problem that a message was not displayed by login
failure. (see attached)
This patch revises next problems.
1)Error message is not displayed in the case of a blank a user name.(or
password)
With this patch a user name and a password of the blank check.
2)Even if an exception occurs by login processing, a message is not displayed
With this patch, a message is displayed.
3)A result of the login processing has the case that is not handled, and a
message is not displayed
With this patch, a message is displayed.
Please test out it first, and let me know your comments or questions.
If everybody likes it, and it meets a criterion for
Heartbeat, I hope the next release includes it officially.
Best Regards,
Hideo YAMAUCHI
*** haclient.py.in 2007-10-22 17:17:59.000000000 +0900
--- haclient.py.in.181 2007-10-22 17:26:18.000000000 +0900
***************
*** 2255,2292 ****
return
def login(self, server, username, password) :
! # connect to one of the cluster
! self.failed_reason = ""
! self.server = server
! port = ""
! if string.find(server, ":") != -1 :
! server,port = string.split(server,":")
! ip = socket.gethostbyname(server)
! ret = mgmt_connect(ip, username, password, port)
! if ret != 0 :
! if ret == -1 :
! self.failed_reason = _("Can't connect to
server")
! elif ret == -2 :
! self.failed_reason =\
! _("Failed in the authentication.\n User Name
or Password may be wrong." \
! "\n or the user doesn't belong to haclient
group")
! mgmt_disconnect()
! return False
! window.statusbar.pop(1)
! window.statusbar.push(1,_("Connected to ")+server)
! self.connected = True
! self.username = username
! self.password = password
! window.statusbar.push(2,_("Updating data from server..."))
! self.update_timer = gobject.timeout_add(200, self.update)
!
! self.do_cmd("regevt\nevt:cib_changed")
! self.do_cmd("regevt\nevt:disconnected")
!
! fd = mgmt_inputfd()
! self.io_tag = gobject.io_add_watch(fd, gobject.IO_IN,
self.on_event, None)
! return True
def query(self, query, keep_in_catch = False) :
result = self.cache_lookup(query)
--- 2255,2307 ----
return
def login(self, server, username, password) :
! try :
! # connect to one of the cluster
! self.failed_reason = ""
! self.server = server
! port = ""
! if string.find(server, ":") != -1 :
! server,port = string.split(server,":")
! ip = socket.gethostbyname(server)
!
! if username == "" :
! self.failed_reason = _("Please input an
username.")
! return False
!
! if password == "" :
! self.failed_reason = _("Please input a
password.")
! return False
!
! ret = mgmt_connect(ip, username, password, port)
! if ret != 0 :
! if ret == -1 :
! self.failed_reason = _("Can't connect
to server")
! elif ret == -2 :
! self.failed_reason =\
! _("Failed in the authentication.\n
User Name or Password may be wrong." \
! "\n or the user doesn't belong to
haclient group")
! else :
! self.failed_reason = _("Can't login to
server")
! mgmt_disconnect()
! return False
! window.statusbar.pop(1)
! window.statusbar.push(1,_("Connected to ")+server)
! self.connected = True
! self.username = username
! self.password = password
! window.statusbar.push(2,_("Updating data from
server..."))
! self.update_timer = gobject.timeout_add(200,
self.update)
!
! self.do_cmd("regevt\nevt:cib_changed")
! self.do_cmd("regevt\nevt:disconnected")
!
! fd = mgmt_inputfd()
! self.io_tag = gobject.io_add_watch(fd, gobject.IO_IN,
self.on_event, None)
! return True
! except :
! self.failed_reason = _("Can't connect to server")
! return False
def query(self, query, keep_in_catch = False) :
result = self.cache_lookup(query)
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/