Skip to content
This repository was archived by the owner on May 9, 2020. It is now read-only.

Commit 5b11729

Browse files
author
Dustin Brown
committed
fixed python3 bug in ChefAPI.from_config_file
1 parent a52b46d commit 5b11729

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

chef/api.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ def _ruby_value(match):
136136
url = key_path = client_name = None
137137
proc = subprocess.Popen('ruby', stdin=subprocess.PIPE, stdout=subprocess.PIPE)
138138
script = config_ruby_script % path.replace('\\', '\\\\').replace("'", "\\'")
139-
out, err = proc.communicate(script)
139+
out, err = proc.communicate(script.encode())
140140
if proc.returncode == 0 and out.strip():
141-
data = json.loads(out)
141+
data = json.loads(out.decode())
142142
log.debug('Ruby parse succeeded with %r', data)
143143
url = data.get('chef_server_url')
144144
client_name = data.get('node_name')

0 commit comments

Comments
 (0)