Skip to content
Snippets Groups Projects
Commit 1370292d authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

SW-402: merged ltastorageoverview from trunk into LOFAR-Release-3_1 for...

SW-402: merged ltastorageoverview from trunk into LOFAR-Release-3_1 for deployment to production as per request by SOS/SDOS
parent bcc3cf14
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,6 @@ set(_py_files
set(resource_files
station_coordinates.conf
LTA-SIP.xsd
)
......
......@@ -3,7 +3,7 @@
import urllib
import requests
from os.path import expanduser
from os.path import expanduser, exists
import xml.etree.ElementTree as ET
import xmlrpclib
import uuid
......@@ -15,6 +15,13 @@ passw = None
#host = "lta-ingest-test.lofar.eu:19443"
host = "lofar-ingest.target.rug.nl:9443"
if not exists(path):
# write default file
with open(path, 'w') as file:
file.write("user=\n")
file.write("password=\n")
file.write("host=\n")
with open(path,'r') as file:
print "Parsing user credentials from",path
for line in file:
......
......@@ -6,7 +6,9 @@ import ltasip
d = os.path.dirname(os.path.realpath(__file__))
XSDPATH = d+"/LTA-SIP.xsd"
def validate(xmlpath, xsdpath=XSDPATH):
DEFAULT_SIP_XSD_PATH = os.path.join(os.environ.get('LOFARROOT', '/opt/lofar'), 'etc', 'lta', 'LTA-SIP.xsd')
def validate(xmlpath, xsdpath=DEFAULT_SIP_XSD_PATH):
'''validates given xml file against given xsd file'''
print "validating", xmlpath, "against", xsdpath
......@@ -103,7 +105,7 @@ def main(xml):
try:
xml = xml
xsd = XSDPATH
xsd = DEFAULT_SIP_XSD_PATH
valid = validate(xml, xsd)
consistent = check_consistency(xml)
return valid and consistent
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment