Validate and set compare types in gerrit trigger
Validate and set compare types in gerrit trigger

Gerrit Trigger does not validate compare types for projects, branches,
file paths, and topics currently and this is error prone.

This change adds a new function which validates the specified compare
types against the list of valid ones and returns the compare type if it
is valid. If not, it throws InvalidAttributeError.

Change-Id: Ic9c17fab2baf3a4b0bd06c3cda319ea7cbf9d623
Signed-off-by: Fatih Degirmenci <efb3b77914738610aed82a1afa690c05f49e8268@ericsson.com>

sebbrandt87/jenkins-job-builder,pyatil/jenkins-job-builder,twc-openstack/jenkins-job-builder,gforcada/jenkins-job-builder,lukas-bednar/jenkins-job-builder,twc-openstack/jenkins-job-builder,joostvdg/jenkins-job-builder,onshape/jenkins-job-builder,electrical/jenkins-job-builder,theforeman/jenkins-job-builder,dataxu/jenkins-job-builder,gforcada/jenkins-job-builder,phinexus/jenkins-job-builder,theforeman/jenkins-job-builder,grdryn/jenkins-job-builder,rsig/jenkins-job-builder,phinexus/jenkins-job-builder,joostvdg/jenkins-job-builder,wsoula/jenkins-job-builder,simzacks/jjb,joostvdg/jenkins-job-builder,linuxmaniac/jenkins-job-builder,david-caro/jenkins-job-builder,david-caro/jenkins-job-builder,stanchan/jenkins-job-builder,OSSystems/jenkins-job-builder,tya/jenkins-job-builder,pyatil/jenkins-job-builder,mjeanson/jenkins-job-builder,phinexus/jenkins-job-builder,sebbrandt87/jenkins-job-builder,mjeanson/jenkins-job-builder,grdryn/jenkins-job-builder,gregsymons/jenkins-job-builder,OSSystems/jenkins-job-builder,simzacks/jjb,GoodgameStudios/jenkins-job-builder,wikimedia/integration-jenkins-job-builder,grdryn/jenkins-job-builder,mjeanson/jenkins-job-builder,puppetlabs/jenkins-job-builder,sunyi00/jenkins-job-builder,CruGlobal/jenkins-job-builder,phinexus/jenkins-job-builder,vredchenko/jenkins-job-builder,GoodgameStudios/jenkins-job-builder,dataxu/jenkins-job-builder,CruGlobal/jenkins-job-builder,vredchenko/jenkins-job-builder,madAndroid/jenkins-job-builder,linuxmaniac/jenkins-job-builder,dataxu/jenkins-job-builder,gforcada/jenkins-job-builder,fuglu/jenkins-job-builder,CruGlobal/jenkins-job-builder,tamac-io/jenkins-job-builder,lukas-bednar/jenkins-job-builder,david-caro/jenkins-job-builder,wsoula/jenkins-job-builder,fuglu/jenkins-job-builder,puppetlabs/jenkins-job-builder,wsoula/jenkins-job-builder,pyatil/jenkins-job-builder,klmitch/jenkins-job-builder,onshape/jenkins-job-builder,wikimedia/integration-jenkins-job-builder,wikimedia/integration-jenkins-job-builder,klmitch/jenkins-job-builder,rsig/jenkins-job-builder,linuxmaniac/jenkins-job-builder,electrical/jenkins-job-builder,gregsymons/jenkins-job-builder,klmitch/jenkins-job-builder,OSSystems/jenkins-job-builder,stanchan/jenkins-job-builder,tya/jenkins-job-builder,puppetlabs/jenkins-job-builder,sunyi00/jenkins-job-builder,tya/jenkins-job-builder,GoodgameStudios/jenkins-job-builder,simzacks/jjb,simzacks/jjb,sebbrandt87/jenkins-job-builder,tamac-io/jenkins-job-builder,onshape/jenkins-job-builder,stanchan/jenkins-job-builder,mjeanson/jenkins-job-builder,theforeman/jenkins-job-builder,rsig/jenkins-job-builder,puppetlabs/jenkins-job-builder,twc-openstack/jenkins-job-builder,twc-openstack/jenkins-job-builder,gforcada/jenkins-job-builder,madAndroid/jenkins-job-builder,pyatil/jenkins-job-builder,fuglu/jenkins-job-builder,lukas-bednar/jenkins-job-builder,sunyi00/jenkins-job-builder,theforeman/jenkins-job-builder,linuxmaniac/jenkins-job-builder,lukas-bednar/jenkins-job-builder,jenshnielsen/jenkins-job-builder,tamac-io/jenkins-job-builder,tamac-io/jenkins-job-builder,david-caro/jenkins-job-builder,jenshnielsen/jenkins-job-builder,OSSystems/jenkins-job-builder,jenshnielsen/jenkins-job-builder,gforcada/jenkins-job-builder,wikimedia/integration-jenkins-job-builder,wsoula/jenkins-job-builder,gregsymons/jenkins-job-builder,vredchenko/jenkins-job-builder,rsig/jenkins-job-builder,joostvdg/jenkins-job-builder,wikimedia/integration-jenkins-job-builder,phinexus/jenkins-job-builder,onshape/jenkins-job-builder,klmitch/jenkins-job-builder,electrical/jenkins-job-builder,dataxu/jenkins-job-builder,madAndroid/jenkins-job-builder