So I was working on changing the yum module to work with the magic module code and … we have a situation.
The yum module accepts the following arguments
state=installed pkg=pkgspec
state=removed pkg=pkgspec
state=latest pkg=pkgspec
informational commands:
list=installed
list=updates
list=available
list=repos
list=pkgspec
Now, the above module has two required arguments and the presence of ANY ONE of them is valid. That means, atleast one of state= and list= should be supplied. To make things a little more complicated, if state= is specified, then we should also have pkg= specified.
Now the module magic code does not take all of this into account. We cannot specify things like “either one of these parameters must be specified”. I am wondering what would be a better way to handle such cases?