From d53a3a83ab6c167536a7b923026c199944bf6358 Mon Sep 17 00:00:00 2001 From: Kostas Ladopoulos Date: Tue, 18 Nov 2014 14:50:26 +0000 Subject: [PATCH] CA-150404: iSCSI login fails with non-ASCII CHAP credentials MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fix addresses the problem of not being able to attach an iSCSI based SR to XenServer, if the target has specified non-ASCII characters for its CHAP username and/or password. Usernames: 江月, üöäÜÖÄáÀ Passwords: 江月江月江月江月江月江月, üöäÜÖÄadmin!23 After the fix: * Attaching an iSCSI SR using a WS2012R2 target. Can use any non-ASCII characters for username but only ASCII for passwords. * Attaching an iSCSI SR using an IET target. Can use any non-ASCII characters for username and passwords. Signed-off-by: Kostas Ladopoulos --- drivers/ISCSISR.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/ISCSISR.py b/drivers/ISCSISR.py index 9daf7b47..d92ba7c3 100755 --- a/drivers/ISCSISR.py +++ b/drivers/ISCSISR.py @@ -153,11 +153,11 @@ def load(self, sr_uuid): self.incoming_chappassword = "" if self.dconf.has_key('incoming_chapuser') \ and (self.dconf.has_key('incoming_chappassword') or self.dconf.has_key('incoming_chappassword_secret')): - self.incoming_chapuser = self.dconf['incoming_chapuser'] + self.incoming_chapuser = self.dconf['incoming_chapuser'].encode('utf-8') if self.dconf.has_key('incoming_chappassword_secret'): - self.incoming_chappassword = util.get_secret(self.session, self.dconf['incoming_chappassword_secret']) + self.incoming_chappassword = util.get_secret(self.session, self.dconf['incoming_chappassword_secret'].encode('utf-8')) else: - self.incoming_chappassword = self.dconf['incoming_chappassword'] + self.incoming_chappassword = self.dconf['incoming_chappassword'].encode('utf-8') self.port = DEFAULT_PORT if self.dconf.has_key('port') and self.dconf['port']: