Class: App::AWSProfile
- Inherits:
-
Object
- Object
- App::AWSProfile
- Defined in:
- lib/core/aws_profile.rb
Constant Summary collapse
- @@profile =
nil
- @@credentials =
nil
Class Method Summary collapse
-
.get ⇒ Object
Get the AWS profile.
-
.get_profile_name ⇒ Object
Convenience method to just get the profile name.
-
.init(config_data) ⇒ Object
Reads the config data and attempts to extract the profile.
Class Method Details
.get ⇒ Object
Get the AWS profile. Returns either the profile (or nil).
31 32 33 |
# File 'lib/core/aws_profile.rb', line 31 def self.get @@profile end |
.get_profile_name ⇒ Object
Convenience method to just get the profile name.
37 38 39 40 |
# File 'lib/core/aws_profile.rb', line 37 def self.get_profile_name return nil if @@credentials.nil? @@profile[PROFILE] end |
.init(config_data) ⇒ Object
Reads the config data and attempts to extract the profile.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/core/aws_profile.rb', line 10 def self.init(config_data) errors = [] # Get the profile out of the config YML. @@profile = config_data['AWS']['Profile'] if config_data.has_key?('AWS') # If no profile found, return. return if @@profile.nil? # Check the credentials exist. @@credentials, more_errors = Blufin::AWS::get_aws_credentials(@@profile) errors.concat(more_errors) # If anything is wrong, output error(s). Blufin::Config::invalid_configuration(App::GEM_NAME, errors) if errors.any? end |