Skip to content

Commit 07b8577

Browse files
author
Gabriel Monroy
committed
Merge pull request #265 from scottstamp/patch-1
Proposed fix for gh#264
2 parents 7740d7f + b666811 commit 07b8577

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

cm/chef.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import subprocess
1010
import tempfile
1111
import time
12+
import socket
1213

1314
from celery.canvas import group
1415

@@ -37,8 +38,8 @@
3738
_d[m[0]] = m[1].strip("'").strip('"')
3839
# set global variables from client.rb
3940
CHEF_SERVER_URL = _d['chef_server_url']
40-
CHEF_NODE_NAME = _d['node_name']
41-
CHEF_CLIENT_NAME = _d['node_name']
41+
CHEF_NODE_NAME = _d.get('node_name', socket.hostname())
42+
CHEF_CLIENT_NAME = _d.get('node_name', socket.hostname())
4243
CHEF_VALIDATION_NAME = _d['validation_client_name']
4344
# read the client key
4445
_client_pem_path = os.path.join(CHEF_CONFIG_PATH, 'client.pem')

0 commit comments

Comments
 (0)