salopensource / sal-scripts

Apache License 2.0
23 stars 31 forks source link

Refactor postflight #4

Closed sheagcraig closed 8 years ago

sheagcraig commented 8 years ago

Grettings @grahamgilbert!

@arubdesu asked me to take a look at his work on the sal-postflight script. He had broken it down into functions and wanted my opinion. I can't leave well enough alone, so I went through and did what I thought needed to get done. At this point, the thing had diverged pretty dramatically from Allister's, and he suggested I should submit the PR rather than him. Thus, the (albeit still pretty spotty) commit logs from the first part of work are with the gist here.

Unfortunately, as time became more crunched, my commits got larger and larger, so trying to piece together each individual change would be rough based on this. However, as far as I can tell, it tests out correctly, aside from the ongoing issue with facter that I haven't even touched yet. (I can do that in this PR if you want).

Basically, the main goal for my refactoring of this was to make it read sensibly for those of us coming to code with very little insider-knowledge to Sal. There was a lot of variable and function renaming to clarify what was done, with comments kept only to those places where things truly need documentation-where something unusual is happening.

There's still some room for improvement here, so I welcome the opportunity to make changes based on discussion; I just wanted to get this out since I feel like the bulk of reorganizing and moving stuff around is done.