cardiff: Moving all grouping code into function
cardiff: Moving all grouping code into function

As all the code to create the groups based on the hw properties is done,
let's put all this stuff into a single function to make the main() code
easier to read.

enovance/edeploy,redhat-cip/edeploy,lebauce/edeploy,redhat-cip/edeploy,lebauce/edeploy,enovance/edeploy,lebauce/edeploy,lebauce/edeploy,redhat-cip/edeploy,redhat-cip/edeploy,enovance/edeploy,enovance/edeploy