Skip to content

Commit

Permalink
Merge pull request #110 from tstrachota/headers
Browse files Browse the repository at this point in the history
Fixes #3598 #4476 - setting locale and timeout of api requests
  • Loading branch information
mbacovsky committed Mar 25, 2014
2 parents 79c3d17 + b44318a commit e29592d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions config/foreman.yml
@@ -0,0 +1,11 @@
:foreman:
:enable_module: true
:host: 'https://localhost/'
:username: 'admin'
:password: 'changeme'

# Check cache status on each request
#:refresh_cache: false

# API request timeout, set -1 for infinity
#:request_timeout: 120 #seconds
2 changes: 2 additions & 0 deletions lib/hammer_cli_foreman/commands.rb
Expand Up @@ -17,6 +17,8 @@ def self.resource_config
config[:logger] = Logging.logger['API']
config[:api_version] = 2
config[:aggressive_cache_checking] = HammerCLI::Settings.get(:foreman, :refresh_cache) || true
config[:headers] = { "Accept-Language" => HammerCLI::I18n.locale }
config[:timeout] = HammerCLI::Settings.get(:foreman, :request_timeout)
config
end

Expand Down

0 comments on commit e29592d

Please sign in to comment.