Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for XML file upload pre-change (DCNE-150) #77

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions plugins/httpapi/nd.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ def send_file_request(self, method, path, file=None, data=None, remote_path=None

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run black -l 159 to format these changes.

# If file_ext is provided, replace the file extension (if present) or add it
if file_ext is not None:
if not file_ext.startswith(".") or file_ext not in set(mimetypes.types_map.keys()):
raise ValueError("Invalid file extension provided. Please provide a valid file extension, with leading dot")
akinross marked this conversation as resolved.
Show resolved Hide resolved
filename = os.path.splitext(os.path.basename(file))[0] + file_ext
else:
filename = os.path.basename(file)
Expand Down
Loading