littlejon / dell-update-mirror

A script written to provide a local mirror copy of the Dell Updates for specific server models, I have only tested and used the mirror that is produced with the Dell Server Lifecycle Controller.
MIT License
23 stars 5 forks source link

Catalog.xml content / baseLocation #1

Closed bjozet closed 3 years ago

bjozet commented 3 years ago

First of all, thanks for sharing this script, we've used it to mirror firmwares/bios for our 100s of dell servers, and it has worked flawlessly for a long time. Awesome!

We usually update our machines via HTTP from idrac / racadm. For example, we specify the URL to "dell.foo.bar", and the idrac will happily pull the Catalog.xml file from there, and present us with any updates it finds that is applicable for the server. But after clicking "install" any downloads will fail with the following error: RED006: Unable to download Update Package.. After some troubleshooting I concluded that Dell recently(?) added two options to the <Manifest> declaration in Catalog.xml, looking like this:

<Manifest baseLocation="downloads.dell.com" baseLocationAccessProtocols="HTTPS" 

This causes idrac to try to download the packages from downloads.dell.com, using the HTTPS protocol, but this fails since we requested HTTP. If we do specify HTTPS and still enter the "dell.foo.bar" (our internal mirror host), the update works, but packages are actually downloaded from downloads.dell.com, not our mirror.

The fix for us is to either update the baseLocation and baseLocationAccessProtocol to match our settings, or to remove both properties. Both paths work so far it seems.

This isn't a problem with dellmirror.py per se, but I was tinkering with adding functionality via PR to use the already imported xml.etree.ElementTree. I've got a rudimentary version that can modify the properties, and write out the file, however the ElementTree actually reformats the whole XML quite a bit, most notably it actually changes values that are CDATA into regular string data. Not sure if this affects anything in any update process.

Also writing this here, so someone else might find it if they're in the same situation, looking for a fix. (we're currently using a quick and dirty oneliner to modify it outside of dellmirror.py after each successfull Catalog.xml update.)

Are you willing to accept a PR that adds optional rewrite of Catalog.xml with custom property values? Or do you perhaps have other suggestions on how to fix it?

bjozet commented 3 years ago

Since the PR hasn't been merged, I piggy-back another fix for the script. Dell has retired the hostname ftp.dell.com, and expects people to use downloads.dell.com. The hardcoded occurrences of the ftp-hostname was updated.

littlejon commented 3 years ago

Hi @bjozet - thanks for the update. I'll run this up and merge the request. Appreciate the input.