Commit 28611d7f authored by Jie Yuan's avatar Jie Yuan
Browse files

add file exceptions

parent ee62b978
......@@ -18,6 +18,10 @@ class SVMONReport:
self.tags=[]
cwd = os.path.dirname(services.__file__)
filename = cwd + "/config.json"
if os.path.exists(filename) == False:
f=open(filename,'w')
f.write('{"site": "kit", "service_type":"b2safe", "host":"irods-3-eudat.lsdf.kit.edu"}')
f.close()
readok = os.access(filename,os.R_OK)
if readok == False:
print("You have no access to read config file: config.json")
......@@ -231,6 +235,9 @@ class SVMONReport:
cwd = os.path.dirname(services.__file__)
filename = cwd + "/config.json"
if os.path.exists(filename) == False:
f = open(filename, 'w')
f.close()
writeok = os.access(filename, os.W_OK)
if writeok == False:
print("You have no access to write config file: config.json")
......@@ -255,6 +262,10 @@ class SVMONReport:
cwd = os.path.dirname(services.__file__)
filename = cwd + "/components.json"
if os.path.exists(filename) == False:
f=open(filename,'w')
f.close()
writeok = os.access(filename,os.W_OK)
if writeok == False:
print("You have no access to write config file: components.json")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment