Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2016-11-30 14:54:21 -0500
committerFrank Becker2016-11-30 14:54:39 -0500
commitb471fc77846cc1e314b1ff73aa87553020b93fd5 (patch)
tree3a7558a7a3b3af730c4f63ff6a31564869cb2222
parent03c7506d479db971747d03a02a323191676226a2 (diff)
downloadorg.eclipse.mylyn.tasks-b471fc77846cc1e314b1ff73aa87553020b93fd5.tar.gz
org.eclipse.mylyn.tasks-b471fc77846cc1e314b1ff73aa87553020b93fd5.tar.xz
org.eclipse.mylyn.tasks-b471fc77846cc1e314b1ff73aa87553020b93fd5.zip
508493: releng: add check if apikey already exsists
Change-Id: I490d6f22a5a55219ac1785eb45c73050cbbf9c1b Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=508493
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb13
1 files changed, 8 insertions, 5 deletions
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb
index c83928d41..40a6bb146 100644
--- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb
@@ -90,11 +90,14 @@ sub install_before_final_checks {
my ($testuser_id_test) = $dbh->selectrow_array(
'SELECT userid FROM profiles WHERE login_name = ? ' ,
undef, 'tests@mylyn.eclipse.org');
- my $sth = $dbh->prepare( "INSERT INTO user_api_keys
- (user_id, api_key, description)
- VALUES (?, ?, ?)");
- $sth->execute($testuser_id_admin, 'XkjcuGGfDcoNx0U6uyMM8ZaNuBlEdjrmXd8In3no', 'Mylyn REST Connector Admin');
- $sth->execute($testuser_id_test, 'wvkz2SoBMBQEKv6ishp1j7NY1R9l711g5w2afXc6', 'Mylyn REST Connector Test');
+ if (!$dbh->selectrow_array('SELECT 1 FROM user_api_keys where user_id > 1')) {
+
+ my $sth = $dbh->prepare( "INSERT INTO user_api_keys
+ (user_id, api_key, description)
+ VALUES (?, ?, ?)");
+ $sth->execute($testuser_id_admin, 'XkjcuGGfDcoNx0U6uyMM8ZaNuBlEdjrmXd8In3no', 'Mylyn REST Connector Admin');
+ $sth->execute($testuser_id_test, 'wvkz2SoBMBQEKv6ishp1j7NY1R9l711g5w2afXc6', 'Mylyn REST Connector Test');
+ }
<% end %>

Back to the top