@@ -53,6 +53,7 @@ def check_tab_file(tabfile, date):
53
53
54
54
# start importing the modules needed
55
55
try :
56
+ print (' >> Testing python imports' )
56
57
import shutil
57
58
import datetime
58
59
import time
@@ -62,24 +63,20 @@ def check_tab_file(tabfile, date):
62
63
import numpy
63
64
import dirsync
64
65
# app
65
- from pgamit import pyRinex
66
66
from pgamit import dbConnection
67
- from pgamit import pyStationInfo
68
- from pgamit import pyArchiveStruct
69
- from pgamit import pyPPP
70
67
from pgamit import pyProducts
71
68
from pgamit import pyOptions
72
- from pgamit import Utils
73
- from pgamit import pyOTL
74
- from pgamit import pyETM
75
69
from pgamit import pyRunWithRetry
76
70
from pgamit import pyDate
77
71
72
+ print (' -- Done' )
73
+
78
74
except :
79
75
return ' -- %s: Problem found while importing modules:\n %s' % (platform .node (), traceback .format_exc ())
80
76
81
77
try :
82
78
if len (software_sync ) > 0 :
79
+ print (' >> Syncing directories' )
83
80
# synchronize directories listed in the src and dst arguments
84
81
from dirsync import sync
85
82
@@ -95,54 +92,68 @@ def check_tab_file(tabfile, date):
95
92
for f in updated :
96
93
print (' -- Updated %s' % f )
97
94
95
+ print (' -- Done' )
96
+
98
97
except :
99
98
return ' -- %s: Problem found while synchronizing software:\n %s ' % (platform .node (), traceback .format_exc ())
100
99
101
100
# continue with a test SQL connection
102
101
# make sure that the gnss_data.cfg is present
103
102
try :
103
+ print (' >> Testing database connection' )
104
104
cnn = dbConnection .Cnn ('gnss_data.cfg' )
105
105
106
106
q = cnn .query ('SELECT count(*) FROM networks' )
107
-
107
+ print ( ' -- Done' )
108
108
except :
109
109
return ' -- %s: Problem found while connecting to postgres:\n %s ' % (platform .node (), traceback .format_exc ())
110
110
111
111
# make sure we can create the production folder
112
112
try :
113
+ print (' >> Testing access to production dir' )
113
114
test_dir = os .path .join ('production/node_test' )
114
115
if not os .path .exists (test_dir ):
115
116
os .makedirs (test_dir )
117
+
118
+ print (' -- Done' )
116
119
except :
117
120
return ' -- %s: Could not create production folder:\n %s ' % (platform .node (), traceback .format_exc ())
118
121
119
122
# test
120
123
try :
124
+ print (' >> Testing gnss_data.cfg file access' )
121
125
Config = pyOptions .ReadOptions ('gnss_data.cfg' )
122
-
126
+ print ( ' -- Done' )
123
127
except :
124
128
return ' -- %s: Problem while reading config file and/or testing archive access:\n %s' \
125
129
% (platform .node (), traceback .format_exc ())
126
130
127
131
if check_archive :
128
-
132
+ print ( ' >> Testing access to archive %s' % Config . archive_path )
129
133
# check that all paths exist and can be reached
130
134
if not os .path .exists (Config .archive_path ):
131
135
return ' -- %s: Could not reach archive path %s' % (platform .node (), Config .archive_path )
136
+ print (' -- Done' )
132
137
138
+ print (' >> Testing access to repository %s' % Config .repository )
133
139
if not os .path .exists (Config .repository ):
134
140
return ' -- %s: Could not reach repository path %s' % (platform .node (), Config .repository )
141
+ print (' -- Done' )
135
142
136
143
# pick a test date to replace any possible parameters in the config file
137
144
date = pyDate .Date (year = 2010 , doy = 1 )
138
145
try :
146
+ print (' >> Testing access to broadcast orbits %s' % Config .brdc_path )
139
147
brdc = pyProducts .GetBrdcOrbits (Config .brdc_path , date , test_dir )
148
+ print (' -- Done' )
140
149
except :
141
150
return ' -- %s: Problem while testing the broadcast ephemeris archive (%s) access:\n %s' \
142
151
% (platform .node (), Config .brdc_path , traceback .format_exc ())
143
152
144
153
try :
154
+ print (' >> Testing access to precise orbits %s' % Config .sp3_path )
145
155
sp3 = pyProducts .GetSp3Orbits (Config .sp3_path , date , Config .sp3types , test_dir )
156
+ print (' -- Done' )
146
157
except :
147
158
return ' -- %s: Problem while testing the sp3 orbits archive (%s) access:\n %s' \
148
159
% (platform .node (), Config .sp3_path , traceback .format_exc ())
@@ -152,25 +163,33 @@ def check_tab_file(tabfile, date):
152
163
for prg in ('crz2rnx' , 'crx2rnx' , 'rnx2crx' , 'rnx2crz' , 'gfzrnx_lx' , 'svdiff' , 'svpos' , 'tform' ,
153
164
'sh_rx2apr' , 'doy' , 'sed' , 'compress' ):
154
165
with pyRunWithRetry .command ('which ' + prg ) as run :
166
+ print (' >> Testing %s' % prg )
155
167
run .run ()
156
168
if run .stdout == '' :
157
169
return ' -- %s: Could not find path to %s' % (platform .node (), prg )
170
+ print (' -- Done' )
158
171
159
172
# check grdtab and ppp from the config file
160
173
for opt in ('grdtab' , 'otlgrid' , 'ppp_exe' ):
161
174
path = Config .options [opt ]
175
+ print (' >> Testing access to %s' % path )
162
176
if not os .path .isfile (path ):
163
177
return ' -- %s: Could not find %s in %s' % (platform .node (), opt , path )
178
+ print (' -- Done' )
164
179
165
180
ppp_path = Config .options ['ppp_path' ]
166
181
for f in ('gpsppp.stc' , 'gpsppp.svb_gps_yrly' , 'gpsppp.flt' , 'gpsppp.stc' , 'gpsppp.met' ):
182
+ print (' >> Testing access to %s' % f )
167
183
if not os .path .isfile (os .path .join (ppp_path , f )):
168
184
return ' -- %s: Could not find %s in %s' % (platform .node (), f , ppp_path )
185
+ print (' -- Done' )
169
186
170
187
if check_atx :
171
188
for frame in Config .options ['frames' ]:
189
+ print (' >> Testing access to %s %s' % (frame , frame ['atx' ]))
172
190
if not os .path .isfile (frame ['atx' ]):
173
191
return ' -- %s: Could not find atx in %s' % (platform .node (), frame ['atx' ])
192
+ print (' -- Done' )
174
193
175
194
if check_gamit_tables is not None :
176
195
# check the gamit tables if not none
0 commit comments