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

[BUG] Backup fails when Proactive Remediation has "/" character in Title #66

Closed
tylerreilly-watercare opened this issue Nov 24, 2022 · 1 comment · Fixed by #67
Closed
Assignees
Labels
bug Something isn't working

Comments

@tylerreilly-watercare
Copy link

There appears to be an issue with backing up Proactive Remediations (and possibly other items) when a "/" character exists in the title as this is passed through to the file path for JSON/YAML backup (which is interpreted as a folder).

Backing up Proactive Remediation: Custom Device Inventory - App/Device Inventory
Traceback (most recent call last):
File "/home/vsts/.local/bin/IntuneCD-startbackup", line 8, in
sys.exit(start())
File "/home/vsts/.local/lib/python3.8/site-packages/IntuneCD/run_backup.py", line 241, in start
run_backup(args.path, args.output, exclude, token)
File "/home/vsts/.local/lib/python3.8/site-packages/IntuneCD/run_backup.py", line 193, in run_backup
config_count += savebackup(path, output, exclude, token)
File "/home/vsts/.local/lib/python3.8/site-packages/IntuneCD/backup_proactiveRemediation.py", line 72, in savebackup
f = open(
FileNotFoundError: [Errno 2] No such file or directory: '/home/vsts/work/1/s/Proactive Remediations//Script Data/Custom Device Inventory - App/Device Inventory_DetectionScript.ps1'
##[error]Bash exited with code '1'.

@tylerreilly-watercare tylerreilly-watercare changed the title Backup fails when Proactive Remediation has "/" character in Title [BUG] Backup fails when Proactive Remediation has "/" character in Title Nov 24, 2022
@almenscorner
Copy link
Owner

I was able to replicate when adding a ´/´ to the name of my proactive remediation configuration. The reason is that it is trying to use the display name of the configuration when saving the scripts. When doing so it does not run clean_filename to remove it from the name.

I have changed it to instead use the filename of the configuration when saving the script to correctly remove the ´/´ from the filename of the script. The changed will be merged soon.

@almenscorner almenscorner self-assigned this Nov 25, 2022
@almenscorner almenscorner added the bug Something isn't working label Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants