-
Notifications
You must be signed in to change notification settings - Fork 1
Add the ability to pass config data in as a flag #24
Conversation
@@ -7,6 +7,7 @@ | |||
c.switch [:r, :reserved], :desc => "Shows reserved instance counts" | |||
c.switch [:i, :instances], :desc => "Shows current instance counts" | |||
c.flag [:t, :tag], :default_value => "no-reserved-instance", :desc => "Read a tag and group separately during audit" | |||
c.flag [:h, :config_hash], :default_value => nil, :desc => "Print the audit according to this config hash instead of to config file" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that should probably be json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm this should somehow describe that it's json. I sort of think we should change the name maybe config_json
or j
end | ||
end | ||
|
||
def perform | ||
if SportNginAwsAuditor::Config.slack | ||
if SportNginAwsAuditor::Config.slack || config_hash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like we should merge these together with the config_hash options overriding the config file
@@ -2,23 +2,30 @@ | |||
|
|||
module SportNginAwsAuditor | |||
class NotifySlack | |||
attr_accessor :text, :channel, :webhook, :username, :icon_url, :icon_emoji, :attachments | |||
attr_accessor :text, :channel, :webhook, :username, :icon_url, :icon_emoji, :attachments, :config_hash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm seems like config
is an ok name not sure hash really adds anything
CR looks good 👍 |
Regression QA is good. Just need to test passing in the config |
The new config option works as well 👍 |
Has QA approval |
Description and Impact
Give the option for passing config information in as a flag, instead of as a file.
Deploy Plan
Rollback Plan
git revert -m 1 MERGE_SHA
and perform another deploy.URLs
QA Plan
GLI_DEBUG=true bin/sport-ngin-aws-auditor audit --config_hash="{:slack=>{:username=>\"AWS Auditor\", :icon_url=>\"http://i.imgur.com/86x8PSg.jpg\", :channel=>\"#[slack channel]\", :webhook=>\"[a valid webhook url]"}}" -s [account]
and see this work!GLI_DEBUG=true bin/sport-ngin-aws-auditor audit [account]
to just make sure it works when using a config file