Skip to content

Commit

Permalink
fix slack class name collision (openshift#2308)
Browse files Browse the repository at this point in the history
1. Gemfile needs to be update to install slack-ruby-client
2. Must use a different name than 'Slack' since the 'slack-ruby-client'
has the same class name.
  • Loading branch information
pruan-rht authored Sep 22, 2021
1 parent e1d756f commit 337bd3b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ gem 'oga' # replacemen for nokogiri when we thought we can workaround it
# gem 'text-table'
# gem 'terminal-table'
gem 'parallel_tests'
gem 'slack-ruby-client'
2 changes: 1 addition & 1 deletion tools/instance_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def print_condensed_usage(usage: nil, options: nil)
filtered_list = res_list.map {|r| r[4] if r[0] !='Workloads' }.compact
users = filtered_list
end
slack_client = BushSlicer::Slack.new
slack_client = BushSlicer::CoreosSlack.new
valid_users, unknown_users = translate_to_slack_users(users: users, slack_client: slack_client)
tag_users_msg = valid_users + " please terminate your long-lived clusters if they are no longer in use\n"
tag_users_msg += "\nThese clusters have no owners association #{unknown_users}\n" if unknown_users.size > 0
Expand Down
6 changes: 3 additions & 3 deletions tools/openshift_qe_slack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require 'slack-ruby-client'

module BushSlicer
class Slack
class CoreosSlack
include Common::Helper

attr_accessor :client, :usergroup_id, :token, :user_list, :users_map, :channel
Expand Down Expand Up @@ -84,8 +84,8 @@ def post_msg(msg: nil, channel: self.channel)
end

if __FILE__ == $0
slack = BushSlicer::Slack.new(channel: '#pruan_slack_bot_sandbox')
#slack = OpenshiftQE::Slack.new #(channel: '#ocp-qe-scale-ci-results')
slack = BushSlicer::CoreosSlack.new(channel: '#pruan_slack_bot_sandbox')
#slack = OpenshiftQE::CoreosSlack.new #(channel: '#ocp-qe-scale-ci-results')
#slack.build_user_lookup_table
#slack.build_user_lookup_table(pre_compiled_result: 'creds/slack_users_map.yaml')
# clusters = [[nil, nil, 29.71, nil],
Expand Down

0 comments on commit 337bd3b

Please sign in to comment.