Remove gerrit_set_agreements

The script was here for transition purposes, which are long-since
past. However, puppet runs it on every run. It's not hurting anything,
except for bunny rabbits.

Change-Id: I651cbf29b2bf137d470f4a29775622fea4e58835
This commit is contained in:
Monty Taylor 2014-04-18 18:34:04 -07:00
parent 3241ba6e24
commit 275a861642
2 changed files with 1 additions and 60 deletions
modules/openstack_project

@ -392,17 +392,6 @@ class openstack_project::gerrit (
}
}
file { '/home/gerrit2/review_site/bin/set_agreements.sh':
ensure => present,
owner => 'root',
group => 'root',
mode => '0755',
content => template('openstack_project/gerrit_set_agreements.sh.erb'),
replace => true,
require => Class['::gerrit']
}
exec { 'set_contributor_agreements':
path => ['/bin', '/usr/bin'],
command => '/home/gerrit2/review_site/bin/set_agreements.sh',
require => File['/home/gerrit2/review_site/bin/set_agreements.sh']
ensure => absent,
}
}

@ -1,48 +0,0 @@
#!/bin/sh
# The point of this script is to update the list of contributor license
# agreements Gerrit knows about. More specifically, in its current form,
# it's being used by Puppet to perform database-specific parts of a
# migration for OpenStack's development and production Gerrit servers
# from Echosign to a Gerrit-managed CLA. As such, a lot of this code can
# be ripped out once that migration is complete (though it doesn't
# necessarily need to be, and can be left in place more or less
# indefinitely without impact).
# This function takes a contributor agreement ID and returns 0 if Y
# (active), 1 if N (inactive) or anything else (including if the CLA
# does not exist). It would be nice to implement this by short name
# instead, but Gerrit does not create the id column with auto_increment
# so we have to know what ID integers we want when creating anyway.
is_active () {
ACTIVE=$(
mysql --defaults-file=/etc/mysql/debian.cnf --batch \
--skip-column-names --execute '
SELECT active FROM contributor_agreements WHERE id='$1';
' reviewdb
)
if test "$ACTIVE" = "Y" ; then
return 0
else
return 1
fi
}
# The old Echosign CLA needs to be invalidated, so if it's active then
# update it to an inactive state.
is_active 1 \
&& mysql --defaults-file=/etc/mysql/debian.cnf --execute '
UPDATE contributor_agreements SET active="N" WHERE id=1;
' reviewdb
# The new Gerrit-managed CLA should be created if it does not yet exist.
# It's added as ID 2 to accomodate the existence of the old Echosign CLA
# occupying ID 1.
is_active 2 \
|| mysql --defaults-file=/etc/mysql/debian.cnf --execute '
INSERT INTO contributor_agreements VALUES (
"Y", "Y", "Y", "<%= cla_name %>",
"<%= cla_description %>",
"<%= cla_file %>", <%= cla_id %>
);
' reviewdb