From c2e908a25aa9ad5be64dba87e44827d8c8b90c01 Mon Sep 17 00:00:00 2001 From: Tim Kuhlman Date: Fri, 27 Jun 2014 14:10:54 -0600 Subject: [PATCH] Cluster script, handle branches better but default to master --- utils/baremetal.py | 4 ++++ utils/cluster/__init__.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/baremetal.py b/utils/baremetal.py index 035400c..e451527 100644 --- a/utils/baremetal.py +++ b/utils/baremetal.py @@ -67,6 +67,10 @@ def git_mini_mon(install_dir, branch=None, proxy=None): if branch is not None: with cd(install_dir): + with settings(hide('everything'), warn_only=True): + branch_exists = sudo('git branch| grep %s' % branch) + if branch_exists.failed: + sudo('git branch {branch} origin/{branch}'.format(branch=branch)) sudo('git checkout %s' % branch) @task(default=True) diff --git a/utils/cluster/__init__.py b/utils/cluster/__init__.py index 0ce1db3..c84c2a4 100644 --- a/utils/cluster/__init__.py +++ b/utils/cluster/__init__.py @@ -41,7 +41,7 @@ class SetupCluster(Task): The data bags in the cluster subdir should be properly setup for the environment before running. """ execute(install_deps) - execute(git_mini_mon, self.mini_mon_dir, 'feature/cluster') + execute(git_mini_mon, self.mini_mon_dir) # download cookbooks with settings(hide('running', 'output', 'warnings'), warn_only=True):