diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-12-16 17:51:15 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-12-19 10:37:33 +0000 |
commit | aae3daf2d677833445ff48fe491e8fd3839fbcf6 (patch) | |
tree | 8744ee8c4e0de27fa8463580a97d158c0a881da4 | |
parent | 6862edbe757b367ad0eeb95cad678825ea719673 (diff) | |
download | definitions-aae3daf2d677833445ff48fe491e8fd3839fbcf6.tar.gz |
pxeboot.check: Check if nfs-server is running when is needed
-rwxr-xr-x | pxeboot.check | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pxeboot.check b/pxeboot.check index fabe8138..4a27dffa 100755 --- a/pxeboot.check +++ b/pxeboot.check @@ -2,6 +2,7 @@ import itertools import os +import subprocess import sys flatten = itertools.chain.from_iterable @@ -74,3 +75,12 @@ else: if mode not in valid_modes: print('%s is not a valid PXEBOOT_MODE' % mode) sys.exit(1) + +if mode != 'existing-server': + with open(os.devnull, 'w') as devnull: + if subprocess.call(['systemctl', 'status', 'nfs-server'], + stdout=devnull) != 0: + print ('ERROR: nfs-server.service is not running and is needed ' + 'for this deployment. Please, run `systemctl start nfs-server` ' + 'and try `morph deploy` again.') + sys.exit(1) |