Project

General

Profile

Bug #9193

Foreman-config script broken

Added by William Hutson almost 4 years ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Category:
Packaging
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

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 (diff)
Added by William Hutson almost 4 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 (diff)
Added by William Hutson over 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 almost 4 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 almost 4 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 almost 4 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 almost 4 years ago

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

Ok. Tested.

#5 Updated by Anonymous almost 4 years ago

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

#6 Updated by Dominic Cleal almost 4 years ago

  • Assignee set to William Hutson
  • Legacy Backlogs Release (now unused) set to 32

Also available in: Atom PDF