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

Script replaces seemingly random existing images with each run #108

Open
st-nip opened this issue Sep 20, 2023 · 2 comments · May be fixed by #150
Open

Script replaces seemingly random existing images with each run #108

st-nip opened this issue Sep 20, 2023 · 2 comments · May be fixed by #150

Comments

@st-nip
Copy link

st-nip commented Sep 20, 2023

With one run, the script will create new device types, but then on subsequent runs it seems to overwrite device images with a new name, then the next sometimes it'll do the same again, and again.

Example: device type EMAT09-10

First run:

Difference

{
"front_image": ""
}

{
"front_image": "devicetype-images/eaton-emat09-10.front.png"
}

Second run:

Difference

{
"front_image": "devicetype-images/eaton-emat09-10.front.png"
}

{
"front_image": "devicetype-images/eaton-emat09-10.front_8zE6qHf.png"
}

Third run:

Difference

{
"front_image": "devicetype-images/eaton-emat09-10.front.png"
}

{
"front_image": "devicetype-images/eaton-emat09-10.front_KCjLwwE.png"
}

Of course, this is completely unnecessary and no doubt is filling up storage with random new images. I'm just wondering - why does the script even overwrite images in the first place? Surely it's enough to upload them once.

I pulled the version of the script down yesterday, so it's a current issue.

@st-nip st-nip changed the title Script replaces seemingy random existing images with each run Script replaces seemingly random existing images with each run Sep 20, 2023
@Azmodeszer
Copy link

Can confirm, seemingly pointless image updates at random.

image

@qspark-eliezerlp
Copy link

This is done automatically by the Netbox API. You can manually recreate this by uploading an image file with the same name as the existing image file for a device type image. It will automatically append something to make the name unique.

Perhaps the solution here is to have a flag that forces overwriting existing images instead of always overwriting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants