Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing --aws-config-file issues #430

Merged
merged 2 commits into from
Jul 27, 2016

Conversation

NimishaS
Copy link

@NimishaS NimishaS commented Jul 25, 2016

Fixes the following:

  1. If --aws-profile option is passed as "default" from CLI, it fails.
  2. Proper exception is not raised if invalid --aws-profile is passed.
  3. Preference should be given to options passed through CLI over options passed though knife.rb.

unless aws_config.values.empty?
if locate_config_value(:aws_config_file)
aws_config = ini_parse(File.read(locate_config_value(:aws_config_file)))
profile = (locate_config_value(:aws_profile) == 'default') ? 'default' : 'profile '+locate_config_value(:aws_profile)
Copy link
Contributor

@btm btm Jul 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please drop the ternary operator here and expand this to multiple lines for readability, e.g.

profile = if locate_config_value(:aws_profile) == 'default'
            'default'
          else
            "profile #{locate_config_value(:aws_profile}"
          end

@btm btm changed the title Fixing --azure-config-file issues Fixing --aws-config-file issues Jul 26, 2016
@btm
Copy link
Contributor

btm commented Jul 26, 2016

👍

@NimishaS NimishaS force-pushed the nim/aws-config-file-fixes branch from b77000c to f9c1c37 Compare July 27, 2016 05:30
@NimishaS NimishaS merged commit 4747159 into chef:master Jul 27, 2016
@NimishaS NimishaS deleted the nim/aws-config-file-fixes branch July 27, 2016 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants