Skip to content

Commit 25160ed

Browse files
committed
pvesh python3 fixes
1 parent 22f2142 commit 25160ed

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

module_utils/pvesh.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import json
55
import re
66

7+
from ansible.module_utils._text import to_text
8+
79
class ProxmoxShellError(Exception):
810
"""Exception raised when an unexpected response code is thrown from pvesh."""
911
def __init__(self, response):
@@ -23,12 +25,13 @@ def run_command(handler, resource, **params):
2325
handler,
2426
resource,
2527
"--output=json"]
26-
for parameter, value in params.iteritems():
28+
for parameter, value in params.items():
2729
command += ["-{}".format(parameter), "{}".format(value)]
2830

2931
pipe = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
3032
(result, stderr) = pipe.communicate()
31-
stderr = stderr.splitlines()
33+
result = to_text(result)
34+
stderr = to_text(stderr).splitlines()
3235

3336
if len(stderr) == 0:
3437
if not result:

0 commit comments

Comments
 (0)