Katello / katello-packaging

[DEPRECATED] Packaging for Katello
7 stars 33 forks source link

Fixes #20805 - kchange-hostname fix optparser error #517

Closed johnpmitsch closed 7 years ago

johnpmitsch commented 7 years ago

optparser isn't recognized inside of functions, so its changed to an instance variable here, and then the prechecks are changed to run before the warning message

theforeman-bot commented 7 years ago

Issues: #20805

johnpmitsch commented 7 years ago

To test

spin up a katello 3.4 production box and run:

yum install -y git vim
cd ~
git clone https://github.com/Katello/katello-packaging
cd katello-packaging
git remote add fork https://github.com/johnpmitsch/katello-packaging
git fetch fork
git checkout fork/opt_parser_bug
cd ~
ln -s katello-packaging/katello/katello-change-hostname katello-change-hostname
chmod a+x katello-change-hostname 

try excluding options and make sure you get an error message and printout of the options. i.e. katello-change-hostname newname (exclude -u and -p options)

then make sure proper input works as well, test any other edge cases you can think of