diff --git a/lib/puppet/functions/gitlab_ci_runner/register.rb b/lib/puppet/functions/gitlab_ci_runner/register.rb index 7bd0b77..b5536df 100644 --- a/lib/puppet/functions/gitlab_ci_runner/register.rb +++ b/lib/puppet/functions/gitlab_ci_runner/register.rb @@ -21,9 +21,8 @@ end def register(url, token, additional_options = {}, ca_file = nil) - if token.start_with?('glrt-') - raise "Gitlab runner failed to register: authentication token provided instead of registration token." - end + token.start_with?('glrt-') and + raise 'Gitlab runner failed to register: authentication token provided instead of registration token.' begin PuppetX::Gitlab::Runner.register(url, additional_options.merge('registration-token' => token), ca_file) diff --git a/lib/puppet_x/gitlab/runner.rb b/lib/puppet_x/gitlab/runner.rb index b1fa2bb..a06887c 100644 --- a/lib/puppet_x/gitlab/runner.rb +++ b/lib/puppet_x/gitlab/runner.rb @@ -73,7 +73,7 @@ def self.register(host, options, proxy = nil, ca_file = nil) def self.verify(host, token, proxy = nil, ca_file = nil) url = "#{host}/api/v4/runners/verify" Puppet.info "Verifying gitlab runner with #{host}" - PuppetX::Gitlab::APIClient.post(url, {'token'=>token}, proxy, ca_file) + PuppetX::Gitlab::APIClient.post(url, { 'token' => token }, proxy, ca_file) end def self.unregister(host, options, proxy = nil, ca_file = nil)