keeleysam / munki-exported

Automatically exported from code.google.com/p/munki
Other
0 stars 0 forks source link

makecatalogs should only complain if installer items are missing #216

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm planning a deployment workflow where my repo won't have the pkgs directory 
at all. Instead the installer items are kept in a separate network share with 
access from multiple admin workstations. I have quite a lot of installers and 
it seems impractical to require them to be always present.

What steps will reproduce the problem?
1. Run makecatalogs on a repo which doesn't have a pkgs directory
2. It outputs "Info file <pkginfo> refers to missing installer item" warning 
messages (as expected) but doesn't write the catalog files.

Removing the "continue" statement on line 139 of makecatalogs allows the for 
loop to continue even if installer item is missing.

--
Hannes Juutilainen

Original issue reported on code.google.com by hjuutila...@mac.com on 24 Jan 2013 at 12:15

GoogleCodeExporter commented 9 years ago
Thanks for this. I agree this should be the correct behavior for makecatalogs.

Original comment by greg.nea...@disneyanimation.com on 24 Jan 2013 at 5:22

GoogleCodeExporter commented 9 years ago
No, wait - I take that back.

If a missing pkg item is _expected_, then adding the item to your catalogs 
would be the correct behavior. But in most cases, that's not expected -- a 
missing pkg would mean the pkginfo item is invalid/useless, so therefore should 
not be added to the catalog.

I think you want a new option to makecatalogs that tells it to not check/not 
care about installer_item_locations.

Original comment by greg.nea...@disneyanimation.com on 24 Jan 2013 at 5:32

GoogleCodeExporter commented 9 years ago
True,

Perhaps a general -f|--force argument to not care about non-fatal errors? And 
if so, could I write the code for this? It's about time I started contributing 
:)

Original comment by hjuutila...@mac.com on 24 Jan 2013 at 6:12

GoogleCodeExporter commented 9 years ago
Yes, please! Especially since you want the functionality.

Original comment by greg.nea...@disneyanimation.com on 24 Jan 2013 at 7:07

GoogleCodeExporter commented 9 years ago
I've now implemented this on my munki mirror on GitHub. Can you pull the 
changes or should I create a clone in Google Code?
https://github.com/hjuutilainen/munki/tree/development

The force option commit is here:
https://github.com/hjuutilainen/munki/commit/7de3a20e9f3f4dda1b2bdfe3d25e44a330a
2bf79

I then made some more changes for code comments and makecatalogs exit codes. 
You can pull those too if they seem reasonable. I'm not sure if I'll personally 
need the exit codes but it would make sense that makecatalogs only exited with 
code 0 if everything was cleanly written to disk.

Original comment by hjuutila...@mac.com on 25 Jan 2013 at 12:29

GoogleCodeExporter commented 9 years ago
I've merged your changes (and made a small tweak to make PyLint happier with 
the code).

Original comment by gregnea...@mac.com on 13 Feb 2013 at 4:20