qops 1.6.0 → 1.6.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: 162f89d3372a53371e18045f54ef22d6b1be4d4e
4
- data.tar.gz: a2532b2299fcdb585506a0d7717cf079a1fa307b
3
+ metadata.gz: ae573e99371d225d3eca19d41a48f13a8a013819
4
+ data.tar.gz: 7feba6d8f128cf7e6a62bf80cf5306d4827db491
5
5
  SHA512:
6
- metadata.gz: 5360220d992d093303b5a2423ebc41d44de8447e4a7bd03384f4094b6d2f6f48b66dbb051f47bb6da8e86d2ff434d480944af75848aa1d2f7b0bc52bb2784015
7
- data.tar.gz: d66505a29b10ef61410553ccb214ae83957e55801aa06244cc798c93ba31a3406225fc829d3553a36b24736e6601d5ba84ef0b9423da56351cafda903c3155eb
6
+ metadata.gz: 102be14735cf3aaf894bcc5b502f4c9bf5d9652651a592428f19978f779f740612bb6b74224273f39618427028a80c6e0f13dd4fc2a5b929d1b0959eec993831
7
+ data.tar.gz: dfe5b532a6da97e65b66474267b843c50d4c1fb8d321ec4dc0ae2894b16a51eed086136b559f92958bd1eb1e59146a307022f5f9499a1689c4555d5b2d966dd9
@@ -35,22 +35,13 @@ module Qops
35
35
  @_aws_config = { region: configuration.region }
36
36
  @_aws_config[:profile] = profile unless profile.nil?
37
37
  @_force_config = force_config
38
+ profile.nil? ? opsworks.config.credentials.credentials : @_aws_config[:profile] = profile
38
39
  puts Rainbow("using aws profile #{profile}").bg(:black).green unless profile.nil?
39
-
40
+ puts Rainbow('Forcing Qops to read the opsworks parameter strictly from yaml') if force_config
40
41
  %w[deploy_type region app_name].each do |v|
41
42
  fail "Please configure #{v} before continuing." unless option?(v)
42
43
  end
43
-
44
- fail 'Please configure the layer_name if you are allowing qops to search aws stacks' unless option?('layer_name')
45
-
46
- # if being forced to use config , then stack_id is a requirement
47
44
  fail 'Please configure stack_id or stack_name before continuing' unless option?('stack_id') || option?('stack_name')
48
-
49
- begin
50
- opsworks.config.credentials.credentials unless profile
51
- rescue => e # rubocop:disable Lint/RescueWithoutErrorClass
52
- raise "There may be a problem with your aws credentials. Please correct with `aws configure`. Error: #{e}"
53
- end
54
45
  end
55
46
 
56
47
  def stack(options = {})
@@ -77,10 +68,12 @@ module Qops
77
68
  opsworks.describe_layers(stack_id: stack_id).layers
78
69
  end
79
70
 
80
- def layer_id(options = {})
71
+ def layer_id(_options = {})
81
72
  return configuration.layer_id if @_force_config
82
- name = options[:layer_name] || configuration.layer_name
83
- layers.find { |layer| layer.name.casecmp(name) }.layer_id
73
+ name = configuration.layer_name
74
+ puts "searching for #{name}"
75
+ layer = layers.find { |l| l.name.match(/#{name}/i) }
76
+ layer.layer_id
84
77
  end
85
78
 
86
79
  def chef_version(options = {})
@@ -118,7 +111,7 @@ module Qops
118
111
 
119
112
  def opsworks_os(options = {})
120
113
  return configuration.os if @_force_config
121
- find_stack(options).default_os
114
+ stack(options).default_os
122
115
  end
123
116
 
124
117
  # Default 1 days
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Qops
4
- VERSION = '1.6.0'.freeze
4
+ VERSION = '1.6.1'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qops
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Basset
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2017-10-18 00:00:00.000000000 Z
15
+ date: 2017-10-20 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: qthor