diff options
-rw-r--r-- | kpov_judge/tasks/smb_nfs/task.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/kpov_judge/tasks/smb_nfs/task.py b/kpov_judge/tasks/smb_nfs/task.py index 1e6121b..a586e33 100644 --- a/kpov_judge/tasks/smb_nfs/task.py +++ b/kpov_judge/tasks/smb_nfs/task.py @@ -92,24 +92,28 @@ def task(SMB_NAME, NFS_MOUNT, SHARED_FILENAME, SHARED_FILENAME_CONTENT): # ["//SMB_NAME/<pot_do_direktorija> on NFS_MOUNT type cifs (rw)", ... ] # example: ["//192.168.1.92/srv/samba on /mnt/samba type cifs (rw)", ... ] # Seznam mora imeti vnos za NFS in SMB, morata biti obesena na pravo pot in (rw) + # ++ PIKE za namountan SMB/NFS for m in srvmounts: # Dobimo pot, filesystem in pravice iz mounta: split = m.split() pot = split[2] - fstype = split[4] + fstype = split[4] #mogoče bomo kaj rabli? pravice = split[5] - # Pregledamo datoteke v temu direktoriju: - ls = subprocess.check_output(["ls", pot]).split() - # Preverimo ce je v imeniku datoteka: - if SHARED_FILENAME in ls: - # Če je, primerjamo vsebino: - cat = subprocess.check_output(["cat", pot+"/"+SHARED_FILENAME]) - if cat == SHARED_FILENAME_CONTENT: - # DING DING DING PLUS PIKE ZA PRAVO VSEBINO + # Preverimo če je namountano na pravilen direktorij: + if pot == NFS_MOUNT: + # ++PIKE za pravo pot + # Pregledamo datoteke v temu direktoriju: + ls = subprocess.check_output(["ls", pot]).split() + # Preverimo ce je v imeniku datoteka: + if SHARED_FILENAME in ls: + # Če je, primerjamo vsebino: + cat = subprocess.check_output(["cat", pot+"/"+SHARED_FILENAME]) + if cat == SHARED_FILENAME_CONTENT: + # DING DING DING PLUS PIKE ZA PRAVO VSEBINO + pass + if pravice == "(rw)": + # BONUS PIKE ZA READ/WRITE PRAVICE pass - if pravice == "(rw)": - # BONUS PIKE ZA READ/WRITE PRAVICE - pass # Samo delno stestirano! |