Permalink
Browse files

Exit if unmaskfile can not be created

  • Loading branch information...
1 parent c1aa675 commit 4aaef2377fc7f52196e912abdb995784237b7009 @tom111 committed Oct 15, 2012
Showing with 11 additions and 4 deletions.
  1. +11 −4 scripts/tatt
View
@@ -179,10 +179,17 @@ if not myJob.packageList==None:
try:
unmaskfile=open(config['unmaskfile'], 'r+')
except IOError:
- # create an empty file, this should be beautified
- unmaskfile=open(config['unmaskfile'], 'w')
- unmaskfile.write(" ")
- unmaskfile.close()
+ print "Your unmaskfile was not found, I will create it as"
+ print config['unmaskfile']
+ try:
+ unmaskfile=open(config['unmaskfile'], 'w')
+ unmaskfile.write(" ")
+ unmaskfile.close()
+ except IOError:
+ print " ".join(["Can not create unmaskfile",config['unmaskfile']])
+ print "Probably you want to configure a different file in your ~/.tatt"
+ print "Exiting"
+ exit(1)
unmaskfile=open(config['unmaskfile'], 'r+')
unmaskfileContent = unmaskfile.read()

0 comments on commit 4aaef23

Please sign in to comment.