Vinzenz Feenstra has uploaded a new change for review.

Change subject: Fix username handling on Windows
......................................................................

Fix username handling on Windows

We forcibly encoded the unicode string to UTF-8 right after retrieval
which broke the encoding later on.

This patch fixes this issue.

Change-Id: I65b33e4f38f801f1770cf94a5ed36234c2fae90d
Bug-Url: https://bugzilla.redhat.com/1010201
Signed-off-by: Vinzenz Feenstra <[email protected]>
(cherry picked from commit 6fc1a18b2be2e93070fce2cd3cb0d5e23e2ecc5e)
---
M ovirt-guest-agent/GuestAgentWin32.py
M ovirt-guest-agent/OVirtAgentLogic.py
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-guest-agent 
refs/changes/37/31537/1

diff --git a/ovirt-guest-agent/GuestAgentWin32.py 
b/ovirt-guest-agent/GuestAgentWin32.py
index 8689a90..e42a101 100644
--- a/ovirt-guest-agent/GuestAgentWin32.py
+++ b/ovirt-guest-agent/GuestAgentWin32.py
@@ -431,8 +431,8 @@
                 user = u"%s@%s" % (user, domain)
         except:
             logging.exception("Error retrieving active user name.")
-        logging.debug("Activer user: %s", user)
-        return user.encode('utf8')
+        logging.debug("Active user: %s", user)
+        return user
 
     def getDisksUsage(self):
         usages = list()
diff --git a/ovirt-guest-agent/OVirtAgentLogic.py 
b/ovirt-guest-agent/OVirtAgentLogic.py
index 21acc3a..5cfcfff 100644
--- a/ovirt-guest-agent/OVirtAgentLogic.py
+++ b/ovirt-guest-agent/OVirtAgentLogic.py
@@ -329,7 +329,7 @@
         self._send('fqdn', {'fqdn': self.dr.getFQDN()})
 
     def sendUserInfo(self, force=False):
-        cur_user = str(self.dr.getActiveUser())
+        cur_user = self.dr.getActiveUser()
         logging.debug("AgentLogicBase::sendUserInfo - cur_user = '%s'" %
                       (cur_user))
         if cur_user != self.activeUser or force:


-- 
To view, visit http://gerrit.ovirt.org/31537
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I65b33e4f38f801f1770cf94a5ed36234c2fae90d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-guest-agent
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Vinzenz Feenstra <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to