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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 234d0202835f94f4ecb493933e9805c1302148a2
4
- data.tar.gz: cac682927dfc758791fcebf8e30a4d37daf98d76
3
+ metadata.gz: 1a07ec80487438ab32f44b7af709d578cdd3e3a3
4
+ data.tar.gz: cc0639ff64e3c992e960b454e2e9dab8faf7e6b6
5
5
  SHA512:
6
- metadata.gz: 76e7a70a6bffa609ce74dbb90783a7835da3876c34e75c19f711bad301d6b517b01e7bc7c2b6a614ec71c6297921cf36c49b01ecc8d5a072a2606cdb29ca99d0
7
- data.tar.gz: 5ab873c9a336c285af66b758931628eaa604e05266454960c4a2974a6ddaa9ab0bcd9e87866c3b2cc8d47bafd0a913ab56fe06675949770667976eae0fcd67f5
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
- if @sns_subscription.save
23
- update_sqs_policy!
24
- subscribe_topic!
25
- redirect_to @sns_subscription, notice: 'SNS subscription was successfully created.'
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
@@ -1,3 +1,3 @@
1
1
  module Barbeque
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barbeque
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun