Bug #9193

Foreman-config script broken

Added by William Hutson about 3 years ago. Updated about 3 years ago.

Status:Closed
Priority:Normal
Assigned To:William Hutson
Category:Packaging
Target version:-
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/foreman/pull/2122
Story points-
Velocity based estimate-
Release1.7.3Release relationshipAuto

Description

The foreman-config script seems to be broken. When using -k/-v to set config values, the script simply returns a list of the current config values:

$ foreman-config -k key -v value
foreman-config script is deprecated. Please consider using `foreman-rake config` instead
administrator: ...
authorize_login_delegation: ...
authorize_login_delegation_api: ...
...

Instead, I would like it to actually update my configs. After come digging, I found the underlying 'rake' command was wrong:

https://github.com/theforeman/foreman/blob/1.7.1/script/foreman-config#L47

should be

exec('rake', '--', 'config', *rake_args)

This happens on at least:
Foreman 1.7.1, Ubuntu 14.04 LTS, Ruby 1.9.3

Associated revisions

Revision f05c3102
Added by William Hutson about 3 years ago

Fixes #9193 - broken rake-config command

foreman-config now actually updates config values when passed -k and -v
instead of dumping a list of the current values.

Revision 2b2adbe3
Added by William Hutson almost 3 years ago

Fixes #9193 - broken rake-config command

foreman-config now actually updates config values when passed -k and -v
instead of dumping a list of the current values.

(cherry picked from commit f05c31020587fa3f58e08a26a47530bd1ef26509)

History

#1 Updated by Lukas Zapletal about 3 years ago

  • Category set to Packaging

I just tested this on CentOS 6/7 and it works fine.

foreman-rake config -- -k puppet_interval -v 99

I am almost sure that we have it correctly. Can you paste bin your error and how to reproduce it?

#2 Updated by William Hutson about 3 years ago

Lukas Zapletal wrote:

I just tested this on CentOS 6/7 and it works fine.

foreman-rake config -- -k puppet_interval -v 99

I am almost sure that we have it correctly. Can you paste bin your error and how to reproduce it?

Hey Lukas,

Here's what I'm doing:

ubuntu@puppet:~$ sudo su - foreman s /bin/bash
foreman@puppet:~$ /usr/sbin/foreman-rake config -
-k puppet_interval -v 99
administrator: ...
authorize_login_delegation: ...
authorize_login_delegation_api: ...

Note it's just listing the configs. But if I move the '--':

foreman@puppet:~$ /usr/sbin/foreman-rake -- config -k puppet_interval -v 99
99

I'm not sure if this is an Ubuntu issue, or a me issue :p

As a side note, this ticket is about the foreman-config (deprecated) script, which is being used by the puppet-foreman module, not foreman-rake.

Thanks for taking a look!

#3 Updated by William Hutson about 3 years ago

William Hutson wrote:

Lukas Zapletal wrote:

I just tested this on CentOS 6/7 and it works fine.

foreman-rake config -- -k puppet_interval -v 99

I am almost sure that we have it correctly. Can you paste bin your error and how to reproduce it?

Hey Lukas,

Here's what I'm doing:

ubuntu@puppet:~$ sudo su - foreman s /bin/bash
foreman@puppet:~$ /usr/sbin/foreman-rake config -
-k puppet_interval -v 99
administrator: ...
authorize_login_delegation: ...
authorize_login_delegation_api: ...

Note it's just listing the configs. But if I move the '--':

foreman@puppet:~$ /usr/sbin/foreman-rake -- config -k puppet_interval -v 99
99

I'm not sure if this is an Ubuntu issue, or a me issue :p

As a side note, this ticket is about the foreman-config (deprecated) script, which is being used by the puppet-foreman module, not foreman-rake.

Thanks for taking a look!

Rake version:

foreman@puppet:~$ /usr/sbin/foreman-rake --version
rake, version 10.4.2

#4 Updated by Lukas Zapletal about 3 years ago

  • Pull request https://github.com/theforeman/foreman/pull/2122 added

Ok. Tested.

#5 Updated by Anonymous about 3 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

#6 Updated by Dominic Cleal about 3 years ago

  • Assigned To set to William Hutson
  • Release set to 1.7.3

Also available in: Atom PDF