summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2015-06-27 15:17:09 +0200
committerJohannes Löthberg <johannes@kyriasis.com>2015-06-27 15:17:09 +0200
commitc2ce177f4d7ff7b86d4a4f748c85eb6e4fc883ed (patch)
tree5b2433c7ca92828ea783a47bc4d8a5cb9ad78671
parenta60dbe2381124167a7ddb65a91dbe45cdabaaf78 (diff)
downloadsmtpd-conf-c2ce177f4d7ff7b86d4a4f748c85eb6e4fc883ed.tar.xz
Print changed-message in green
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
-rw-r--r--fabfile.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/fabfile.py b/fabfile.py
index 93df7de..78ff494 100644
--- a/fabfile.py
+++ b/fabfile.py
@@ -13,10 +13,12 @@ def checksum_match(local_file, remote_file):
@task
def upload_conf():
+ from fabric.colors import green
+
local_file = '{}/smtpd.conf'.format(env.host)
if not checksum_match(local_file, '/etc/smtpd/smtpd.conf'):
- print("Config changed, uploading new file...")
+ print(green('Config changed, uploading new file...'))
put(local_path=local_file, remote_path='/etc/smtpd/smtpd.conf',
use_sudo=True)
sudo('systemctl restart smtpd.service')
@@ -24,10 +26,12 @@ def upload_conf():
@task
def upload_users():
+ from fabric.colors import green
+
local_file = 'common/users'
if not checksum_match(local_file, '/etc/smtpd/users'):
- print("Users changed, uploading new file...")
+ print(green('Users changed, uploading new file...'))
put(local_path=local_file, remote_path='/etc/smtpd/users',
use_sudo=True)
sudo('smtpctl update table users')