generate token for foreman

this relate to recent change in foreman:
http://theforeman.org/issues/2109

addressing:
130108-20:15:11 debug: Executing '/usr/bin/ruby /usr/share/foreman/script/foreman-config -k oauth_active -v 'true'                              -k foreman_url -v '10-16-120-136.dhcp.rhq.lab.eng.bos.redhat.com'                              -k token_duration -v '60'                              -k manage_puppetca -v false                              -k oauth_consumer_key -v 'katello'                              -k oauth_consumer_secret -v 'u5l76IGiuHiL5BuxlPoRIUlPmA51GtCi'                              -k oauth_map_users -v 'true'                              -k administrator -v 'root@localhost.localdomain''
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns: /usr/share/foreman/config/initializers/secret_token.rb:6:in `read': Permission denied - /usr/share/foreman/tmp/secret_token (Errno::EACCES)
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/share/foreman/config/initializers/secret_token.rb:6
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/engine.rb:201:in `load'
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/engine.rb:201
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/engine.rb:200:in `each'
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/engine.rb:200
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/initializable.rb:25:in `instance_exec'
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/initializable.rb:25:in `run'
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/initializable.rb:50:in `run_initializers'
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/initializable.rb:49:in `each'
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/initializable.rb:49:in `run_initializers'
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/application.rb:134:in `initialize!'
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/application.rb:77:in `send'
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/application.rb:77:in `method_missing'
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/share/foreman/config/environment.rb:5
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require'
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require'
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:225:in `load_dependency'
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:593:in `new_constants_in'
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:225:in `load_dependency'
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require'
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/application.rb:103:in `require_environment!'
130108-20:15:16 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/share/foreman/script/foreman-config:75
130108-20:15:16 err: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns: change from notrun to 0 failed: /usr/bin/ruby /usr/share/foreman/script/foreman-config -k oauth_active -v 'true'                              -k foreman_url -v '10-16-120-136.dhcp.rhq.lab.eng.bos.redhat.com'                              -k token_duration -v '60'                              -k manage_puppetca -v false                              -k oauth_consumer_key -v 'katello'                              -k oauth_consumer_secret -v 'u5l76IGiuHiL5BuxlPoRIUlPmA51GtCi'                              -k oauth_map_users -v 'true'                              -k administrator -v 'root@localhost.localdomain' returned 1 instead of one of [0] at /usr/share/katello/install/puppet/modules/foreman/manifests/config.pp:106
130108-20:15:16 debug: Exec[foreman_config](provider=posix): Executing '/usr/bin/ruby /usr/share/foreman/script/foreman-config -k oauth_active -v 'true'                              -k foreman_url -v '10-16-120-136.dhcp.rhq.lab.eng.bos.redhat.com'                              -k token_duration -v '60'                              -k manage_puppetca -v false                              -k oauth_consumer_key -v 'katello'                              -k oauth_consumer_secret -v 'u5l76IGiuHiL5BuxlPoRIUlPmA51GtCi'                              -k oauth_map_users -v 'true'                              -k administrator -v 'root@localhost.localdomain''
130108-20:15:16 debug: Executing '/usr/bin/ruby /usr/share/foreman/script/foreman-config -k oauth_active -v 'true'                              -k foreman_url -v '10-16-120-136.dhcp.rhq.lab.eng.bos.redhat.com'                              -k token_duration -v '60'                              -k manage_puppetca -v false                              -k oauth_consumer_key -v 'katello'                              -k oauth_consumer_secret -v 'u5l76IGiuHiL5BuxlPoRIUlPmA51GtCi'                              -k oauth_map_users -v 'true'                              -k administrator -v 'root@localhost.localdomain''
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns: /usr/share/foreman/config/initializers/secret_token.rb:6:in `read': Permission denied - /usr/share/foreman/tmp/secret_token (Errno::EACCES)
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/share/foreman/config/initializers/secret_token.rb:6
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/engine.rb:201:in `load'
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/engine.rb:201
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/engine.rb:200:in `each'
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/engine.rb:200
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/initializable.rb:25:in `instance_exec'
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/initializable.rb:25:in `run'
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/initializable.rb:50:in `run_initializers'
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/initializable.rb:49:in `each'
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/initializable.rb:49:in `run_initializers'
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/application.rb:134:in `initialize!'
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/application.rb:77:in `send'
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/application.rb:77:in `method_missing'
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/share/foreman/config/environment.rb:5
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require'
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require'
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:225:in `load_dependency'
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:593:in `new_constants_in'
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:225:in `load_dependency'
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require'
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/application.rb:103:in `require_environment!'
130108-20:15:21 notice: /Stage[main]/Foreman::Config/Exec[foreman_config]/returns:      from /usr/share/foreman/script/foreman-config:75
130108-20:15:21 err: /Stage[main]/Foreman::Config/Exec[foreman_config]: Failed to call refresh: /usr/bin/ruby /usr/share/foreman/script/foreman-config -k oauth_active -v 'true'
run security:generate_token only if token does not exist
882311 - remove scope-based organization hiding when deleting it
882311 - hide and check organizations being deleted
run system-test on os x without warning
Merge pull request #1376 from xsuchy/pull-req-token

generate token for foreman
New shiny README.md for Katello repo
Merge pull request #1361 from iNecas/readme

New shiny README.md for Katello repo
fix config_template info formatting
Merge pull request #1378 from pitr-ch/quick-fix/system-tests

fix a system tests in config_template section
890000 - enabling certv3 in candlepin conf
Merge pull request #1381 from jsomara/890000

890000 - enabling certv3 in candlepin conf
Merge pull request #1358 from lzap/user-org-deletion-882311

User org deletion 882311
emails - add default From to login/password emails

It was observed that with the nightly build the password reset
and login emails were no longer being sent for RHEL server
configurations.

During investigation, found the following in the delayed_jobs.log:

2013-01-10T12:10:41-0500: [Worker(delayed_job host:katello.com pid:28884)]
Class#logins failed with ArgumentError: A sender (Return-Path, Sender or From)
required to send a message - 0 failed attempts

In order to address this, we are adding a configuration property
(email_reply_address) to the katello.yml that may be used to specify
the address. If not specified, a default of 'no-reply@host' will be
used, where host is the value specified for that property.

Note: in the future, we may want to add this to the UI in the
form of a database attribute; however, we might want to consider
having the email specified at different levels possibly based on
org or classification of email (e.g. login related emails, consumer
related emails...etc)
Merge pull request #1387 from bbuckingham/fork-email_from

emails - add default From to login/password emails
820392 - repository hostname validation

Allow not fully qualified names as a repository URL. Also allow
numbers as first characters. Added some specs for edge cases.
Move all validators to one place

Since validators are not models they should not be in app/models.
All validators are now placed in lib/validators/ and each has its own
definition file.

All validators are in module Validators. When you want to use custom
validation in model you must specify a validator class so it gets loaded
by autoloader. If you use DSL provided by ActiveModel::Validations for
custom validator you'll receive unknown validator error because models
are loaded before lib. That's why we should always use validates_with
when dealing with custom validators.
Code cleanup

To obtain boolean as a result !! is usually used. Also parenthesis in
method definiton for arguments should be used.
Repository feed validation moved to validator

Validation was performed in controllers in API and UI which was not DRY.
This logic is extracted in existing KatelloUrlFormatValidator that was
not used anywhere. This validator uses KatelloUrlHelper which I left
intouched because it can be reused more easily than validator itself.

Since tests did not specify feed because it was not required until now I
had to add feed info wherever fake repository was created.
cli completion - fix in sed expression