summaryrefslogtreecommitdiff
path: root/ironic_python_agent/agent.py
diff options
context:
space:
mode:
authorJay Faulkner <jay@jvf.cc>2014-04-04 13:30:42 -0700
committerJay Faulkner <jay@jvf.cc>2014-04-07 11:39:23 -0700
commitc121bef9f0ffc1cf6719b7fdc1792f7e677291b3 (patch)
tree8dfefb55b783f8f6324d7b7d890c775daa7453a5 /ironic_python_agent/agent.py
parentcae81837ce64159cd3acc564bb21d015524612d1 (diff)
downloadironic-python-agent-c121bef9f0ffc1cf6719b7fdc1792f7e677291b3.tar.gz
Compatibility fixes for Python 3.3
1) Added a py33 environment to tox 2) Updated tests to mock the correctly named builtins.open based on python version 3) Other minor compatibility fixes Tests for Python 3.3 will not pass due to this bug: https://github.com/eventlet/eventlet/issues/83 among possibly others in eventlet. Change-Id: Ie4b512a926fa690ee77a71a89851c871ea1f6be0
Diffstat (limited to 'ironic_python_agent/agent.py')
-rw-r--r--ironic_python_agent/agent.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ironic_python_agent/agent.py b/ironic_python_agent/agent.py
index 80a74412..8bef4661 100644
--- a/ironic_python_agent/agent.py
+++ b/ironic_python_agent/agent.py
@@ -19,6 +19,7 @@ import threading
import time
import pkg_resources
+import six
from stevedore import extension
from wsgiref import simple_server
@@ -148,7 +149,7 @@ class IronicPythonAgent(object):
return self.node['uuid']
def list_command_results(self):
- return self.command_results.values()
+ return list(self.command_results.values())
def get_command_result(self, result_id):
try:
@@ -171,7 +172,7 @@ class IronicPythonAgent(object):
extension_part, command_part = self._split_command(command_name)
if len(self.command_results) > 0:
- last_command = self.command_results.values()[-1]
+ last_command = list(self.command_results.values())[-1]
if not last_command.is_done():
raise errors.CommandExecutionError('agent is busy')
@@ -192,7 +193,7 @@ class IronicPythonAgent(object):
result = base.SyncCommandResult(command_name,
kwargs,
False,
- unicode(e))
+ six.text_type(e))
self.command_results[result.id] = result
return result