File tree 1 file changed +5
-6
lines changed 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -125,21 +125,20 @@ def clear(queue = False):
125
125
if not atjobs : return True # No jobs, queue already clear.
126
126
return atrm (* atjobs )
127
127
128
- def _can_read_file (self , filename ):
128
+ def _can_read_file (filename ):
129
129
""" On many installations, at.allow and at.deny are not readable by non-root
130
130
users. Assure that they are. """
131
131
if not os .access (filename , os .F_OK ): # No file there
132
- return False
132
+ raise OSError ( "No file {0}. Make sure path is right." . format ( filename ))
133
133
134
134
if not os .access (filename , os .R_OK ): # Can't read file
135
- raise OSError (' No permission to use {0}. Try the ' +
136
- ' command `chown 644 {0}` as root.' ) .format (filename )
135
+ raise OSError (" No permission to use {0}. Try the " +
136
+ " command `chmod 644 {0}` as root." .format (filename ) )
137
137
138
138
def _enumerate_users (filename ):
139
139
""" Enumerate users in a at.allow or at.deny file, and return them as a
140
140
list() for the user. """
141
- if not _can_read_file (filename ): # No file there
142
- return []
141
+ _can_read_file (filename )
143
142
144
143
fd = open (filename , 'r' )
145
144
users = fd .readlines ()
You can’t perform that action at this time.
0 commit comments