Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Set node name to be hostname #114

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use hostname to pull node info
nephomaniac committed Jul 21, 2016
commit 53f96c355b3efde7c609df71652fffc8c6cc9570
14 changes: 10 additions & 4 deletions calyptos/chefmanager.py
Original file line number Diff line number Diff line change
@@ -201,8 +201,14 @@ def push_deployment_data(self):
ssh_opts=self.ssh_opts, delete=True)

def pull_node_info(self):
local_path = 'chef-repo/nodes/' + run('hostname') + '.json'
hostname = run('hostname')
local_path = 'chef-repo/nodes/' + str(hostname) + '.json'
remote_path = self.remote_folder_path + local_path
if self.local_hostname != run('hostname'):
get(remote_path=remote_path, local_path=local_path)
self.read_node_hash(local_path)
try:
if self.local_hostname != hostname:
get(remote_path=remote_path, local_path=local_path)
self.read_node_hash(local_path)
except Exception as E:
print red('Failed to download node info. Localpath:{0}, remotepath:{1}'
.format(local_path, remote_path))
raise E