barbeque 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/barbeque/sns_subscriptions_controller.rb +16 -6
- data/lib/barbeque/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a07ec80487438ab32f44b7af709d578cdd3e3a3
|
4
|
+
data.tar.gz: cc0639ff64e3c992e960b454e2e9dab8faf7e6b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26042a230e695187cc8bf37c6842189a42909512c22fd5a5bfc328cf22d88257f498532a644973f4dfc788988d65e8aedf29c4f57d15aa8e7ed52356862c6567
|
7
|
+
data.tar.gz: 36e3894bdba8d78175fab0610031e8953086b0ee1f6a538b2b1beeda9b3c1d79da706b0065369a20494a6d4e13ee1fe7cc66fed98bb67cd88885cbff32d1c010
|
@@ -18,11 +18,22 @@ class Barbeque::SnsSubscriptionsController < Barbeque::ApplicationController
|
|
18
18
|
|
19
19
|
def create
|
20
20
|
@sns_subscription = Barbeque::SNSSubscription.new(params.require(:sns_subscription).permit(:topic_arn, :job_queue_id, :job_definition_id))
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
if @sns_subscription.valid?
|
22
|
+
begin
|
23
|
+
subscribe_topic!
|
24
|
+
rescue Aws::SNS::Errors::AuthorizationError
|
25
|
+
@sns_subscription.errors[:topic_arn] << 'is not authorized'
|
26
|
+
@sns_topic_arns = fetch_sns_topic_arns
|
27
|
+
render :new
|
28
|
+
rescue Aws::SNS::Errors::NotFound
|
29
|
+
@sns_subscription.errors[:topic_arn] << 'is not found'
|
30
|
+
@sns_topic_arns = fetch_sns_topic_arns
|
31
|
+
render :new
|
32
|
+
else
|
33
|
+
@sns_subscription.save!
|
34
|
+
update_sqs_policy!
|
35
|
+
redirect_to @sns_subscription, notice: 'SNS subscription was successfully created.'
|
36
|
+
end
|
26
37
|
else
|
27
38
|
render :new
|
28
39
|
end
|
@@ -31,7 +42,6 @@ class Barbeque::SnsSubscriptionsController < Barbeque::ApplicationController
|
|
31
42
|
def update
|
32
43
|
@sns_subscription = Barbeque::SNSSubscription.find(params[:id])
|
33
44
|
if @sns_subscription.update(params.require(:sns_subscription).permit(:job_definition_id))
|
34
|
-
update_sqs_policy!
|
35
45
|
redirect_to @sns_subscription, notice: 'SNS subscription was successfully updated.'
|
36
46
|
else
|
37
47
|
render :edit
|
data/lib/barbeque/version.rb
CHANGED