Skip to content

Commit 90cc0e5

Browse files
committed
Formating
1 parent 41681ee commit 90cc0e5

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

nxc/protocols/nfs.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def get_file(self):
272272
attrs = self.nfs3.getattr(mnt_info["mountinfo"]["fhandle"], auth=self.auth)
273273
self.auth["uid"] = attrs["attributes"]["uid"]
274274
dir_handle = mnt_info["mountinfo"]["fhandle"]
275-
275+
276276
# Get the file handle and read the file data
277277
dir_data = self.nfs3.lookup(dir_handle, file_name, auth=self.auth)
278278
file_handle = dir_data["resok"]["object"]["data"]
@@ -322,11 +322,12 @@ def put_file(self):
322322
# Mount the NFS share to create the file
323323
mnt_info = self.mount.mnt(remote_file_path, self.auth)
324324
dir_handle = mnt_info["mountinfo"]["fhandle"]
325+
325326
# Update the UID from the directory
326327
attrs = self.nfs3.getattr(dir_handle, auth=self.auth)
327328
self.auth["uid"] = attrs["attributes"]["uid"]
328-
329-
# Checking if file_name is already exist on remote file path
329+
330+
# Checking if file_name already exists on remote file path
330331
lookup_response = self.nfs3.lookup(dir_handle, file_name, auth=self.auth)
331332

332333
# If success, file_name does not exist on remote machine. Else, trying to overwrite it.
@@ -340,11 +341,10 @@ def put_file(self):
340341
file_handle = res["resok"]["obj"]["handle"]["data"]
341342
self.logger.success(f"{file_name} successfully created")
342343
else:
343-
# Asking to user overwriting.
344-
ans = input(highlight(f"[!] {file_name} is already exist on {remote_file_path}. Do you want to overwrite it? [Y/n] ", "red"))
344+
# Asking the user if they want to overwrite the file
345+
ans = input(highlight(f"[!] {file_name} already exists on {remote_file_path}. Do you want to overwrite it? [Y/n] ", "red"))
345346
if ans.lower() in ["y", "yes", ""]:
346-
# Overwriting
347-
self.logger.display(f"{file_name} is already exist on {remote_file_path}. Trying to overwrite it...")
347+
self.logger.display(f"{file_name} already exists on {remote_file_path}. Trying to overwrite it...")
348348
file_handle = lookup_response["resok"]["object"]["data"]
349349
else:
350350
self.logger.fail(f"Uploading was not successful. The {file_name} is exist on {remote_file_path}")

0 commit comments

Comments
 (0)