aboutsummaryrefslogtreecommitdiff
path: root/loader.py
diff options
context:
space:
mode:
authorDonald Delmar Davis <ddavis3@jaguarlandrover.com>2014-12-12 00:44:35 +0000
committerDonald Delmar Davis <ddavis3@jaguarlandrover.com>2014-12-12 00:44:35 +0000
commitcaa1a4f3d6f365408dfeee37e7844e1dee60a2c7 (patch)
treea13253983b71e0649a8564d7193a814b9ba4113a /loader.py
parent94f8c3f145d592bf1be3102599ee6d8113b562ec (diff)
rudimentrey system checks
Diffstat (limited to 'loader.py')
-rwxr-xr-xloader.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/loader.py b/loader.py
index 512b6e7..8d07e0a 100755
--- a/loader.py
+++ b/loader.py
@@ -28,8 +28,27 @@ def read_stderr_realtime(proc, stream='stderr'):
out = ''.join(out)
yield out
+def check_environment(d):
+ d.set_background_title("Checking your environment")
+ if subprocess.check_call(["ping", "8.8.8.8", "-c1", "-W5"]) != 0:
+ d.set_background_title("Fatal: Not Connected To Network")
+ d.msgbox("Please check your network connection and restart")
+ sys.exit(1)
+ if subprocess.check_call(["ping", "192.168.4.200", "-c1", "-W5"]) != 0:
+ d.set_background_title("Fatal: Can not find depot")
+ d.msgbox("Please check your network connection and restart")
+ sys.exit(1)
+ if subprocess.check_call(["mount","depot:/home/public/images","/mnt/images"]) !=0:
+ d.set_background_title("Fatal: Can not mount images directory")
+ d.msgbox("Please contact your system administrator")
+ sys.exit(1)
+
d = Dialog(dialog="dialog")
+
+check_environment(d)
+
d.set_background_title("Select file to load.....")
+
code, selection = d.fselect('/mnt/images/',10,70)
if code == d.OK :