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

Tenant Names with Special Characters #11

Open
ve6mad opened this issue Mar 17, 2021 · 1 comment
Open

Tenant Names with Special Characters #11

ve6mad opened this issue Mar 17, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ve6mad
Copy link

ve6mad commented Mar 17, 2021

We've got some tenants that are using a "/" in their name causing python to not create the file and crash with the following:

16/03/2021 07:38:50 PM - INFO - Verifying output parameter passed Traceback (most recent call last): File "sophos_central_main.py", line 570, in <module> main(args) File "sophos_central_main.py", line 488, in main get_inventory(tenant_info, output, page_size, splunk_creds, tenant) File "sophos_central_main.py", line 140, in get_inventory events = api_output.process_output(output, json_data, tenant_url_data, tenant_id, api, sourcetype_value) File "C:\Users\administrator.CORP\Documents\sophos_mar2021\lib\site-packages\sophos_central_api_connector\sophos_central_api_output.py", line 23, in process_output process_output_json(json_items, filename, api) File "C:\Users\administrator.CORP\Documents\sophos_mar2021\lib\site-packages\sophos_central_api_connector\sophos_central_api_output.py", line 44, in process_output_json with open(os.path.join(final_inv_path, filename), "w", encoding='utf-8') as ep_file: FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\administrator.CORP\\Documents\\sophos_mar2021\\lib\\site-packages\\sophos_central_api_connector\\output\\get_inventory\\**/*** Unlimited_fdb34fa2-fa6b-4217-92e9-76294a158613.json'

Would be good to potentially have a catch statement for special characters and replace them with either underscores or allowable characters.

Thanks!

@moledaemon moledaemon self-assigned this Mar 17, 2021
@moledaemon
Copy link
Collaborator

Thanks for raising this. Will take a look and get something in place to handle special characters

Thanks

@moledaemon moledaemon added the enhancement New feature or request label Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants