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-16 17:56:09 +0000 |
commit | 29f0115963bf43622c8113bb95c53dd8b425cc9e (patch) | |
tree | 0384582b388521c4efc2108ab32258acfa4db3d4 | |
parent | 7bf91d8b8a6c9bb3080d77b1c12e2ebec3c4601b (diff) | |
download | definitions-29f0115963bf43622c8113bb95c53dd8b425cc9e.tar.gz |
pxeboot.check: Check if nfs-server is running when is needed
-rwxr-xr-x | pxeboot.check | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/pxeboot.check b/pxeboot.check index 885a0541..468b76e2 100755 --- a/pxeboot.check +++ b/pxeboot.check @@ -2,6 +2,7 @@ import itertools import os +import subprocess import sys flatten = itertools.chain.from_iterable @@ -66,11 +67,18 @@ else: if all(o in os.environ for o in opt_set)) except ValueError as e: - print('More than one candidate for PXEBOOT_MODE, please ' - 'set a value for it. Type `morph help pxeboot.write for ' - 'more info') + print ('More than one candidate for PXEBOOT_MODE, please ' + 'set a value for it. Type `morph help pxeboot.write for ' + 'more info') sys.exit(1) if mode not in valid_modes: print('%s is not a valid PXEBOOT_MODE' % mode) sys.exit(1) + +if mode != 'existing-server': + if subprocess.call(['systemctl', 'status', 'nfs-server']) != 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) |