Hello
Since cpsetup is designed to be executed mainly under root account, it is not necessary to call all the commands via "sudo". This patch adds a simple check - if cpsetup is executed under root, sudo is not used at all.
We have issues in our Katello Puppet installer because of interactive terminal that sudo can open. This helps us to use cpsetup without modifying sudoers file.
This patch does not modify current behavior - cpsetup can be still called under regular (non-root) account and sudo will be used.