From 795173ac8684a67bff8ffe7e001a9d5f9816ad3e Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 4 Jun 2013 18:21:47 -0400 Subject: [PATCH] update-deployment: Move color codes to humbug_tools.py. (imported from commit 96a79a699ea032714b24aa6572fd188433b979a8) --- tools/humbug_tools/__init__.py | 7 +++++++ tools/restart-server | 7 +------ tools/update-deployment | 9 +-------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/tools/humbug_tools/__init__.py b/tools/humbug_tools/__init__.py index 07183ee0a8..a42d6b674e 100755 --- a/tools/humbug_tools/__init__.py +++ b/tools/humbug_tools/__init__.py @@ -19,3 +19,10 @@ def check_output(*popenargs, **kwargs): DEPLOYMENTS_DIR = "/home/humbug/humbug-deployments" LOCK_DIR = os.path.join(DEPLOYMENTS_DIR, "lock") TIMESTAMP_FORMAT = '%Y-%m-%d-%H-%M-%S' + +# Color codes +OKBLUE = '\033[94m' +OKGREEN = '\033[92m' +WARNING = '\033[93m' +FAIL = '\033[91m' +ENDC = '\033[0m' diff --git a/tools/restart-server b/tools/restart-server index 23ab3094e6..d1745bb301 100755 --- a/tools/restart-server +++ b/tools/restart-server @@ -6,15 +6,10 @@ import pylibmc import traceback import logging import time +from humbug_tools import ENDC, WARNING, OKGREEN logging.basicConfig(format="%(asctime)s restart-server: %(message)s", level=logging.INFO) -# Color codes -OKBLUE = '\033[94m' -OKGREEN = '\033[92m' -WARNING = '\033[93m' -FAIL = '\033[91m' -ENDC = '\033[0m' os.chdir("/home/humbug/humbug-deployments/current") diff --git a/tools/update-deployment b/tools/update-deployment index 11999cde31..53b06d45bd 100755 --- a/tools/update-deployment +++ b/tools/update-deployment @@ -5,20 +5,13 @@ import subprocess import pylibmc import traceback import logging -from humbug_tools import check_output, DEPLOYMENTS_DIR, LOCK_DIR, TIMESTAMP_FORMAT +from humbug_tools import check_output, DEPLOYMENTS_DIR, LOCK_DIR, TIMESTAMP_FORMAT, FAIL, ENDC import datetime import shutil logging.basicConfig(format="%(asctime)s update-deployment: %(message)s", level=logging.INFO) -# Color codes -OKBLUE = '\033[94m' -OKGREEN = '\033[92m' -WARNING = '\033[93m' -FAIL = '\033[91m' -ENDC = '\033[0m' - if len(sys.argv) > 1: oldrev = sys.argv[1] newrev = sys.argv[2]