Project

General

Profile

Bug #6275

migrate_settings.yml doesn't return 1 on migrated config file

Added by Dominic Cleal almost 5 years ago. Updated 10 months ago.

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

Description

The migrate_settings.yml script isn't returning 1 when used against a migrated config file (e.g. the example configs):

[root@foreman test]# /usr/share/foreman-proxy/extra/migrate_settings.rb /etc/foreman-proxy/settings.yml ; echo $?
0
[root@foreman test]# ll
total 4
-rw-r--r--. 1 root root 80 Jun 18 17:26 settings.yml
[root@foreman test]# cat settings.yml 
--- 
:settings_directory: /etc/foreman-proxy/settings.d
:virsh_network: default

Causing upgrades to fail as a bad config overwrites the real one:

[root@foreman test]# ll /etc/foreman-proxy/
total 8
drwxr-xr-x. 2 root root 4096 Jun 18 17:25 settings.d
-rw-r--r--. 1 root root 1706 Jun 18 14:58 settings.yml
[root@foreman test]# rpm -Uvh "http://yum.theforeman.org/nightly/el6/x86_64/foreman-proxy-1.6.0-0.develop.201406181440git038fa6c.el6.noarch.rpm" 
Retrieving http://yum.theforeman.org/nightly/el6/x86_64/foreman-proxy-1.6.0-0.develop.201406181440git038fa6c.el6.noarch.rpm
Preparing...                ########################################### [100%]
   1:foreman-proxy          ########################################### [100%]
warning: %postun(foreman-proxy-1.6.0-0.develop.el6.noarch) scriptlet failed, exit status 1
[root@foreman test]# ll /etc/foreman-proxy/
total 8
drwxr-xr-x. 2 root root 4096 Jun 18 17:25 settings.d
-rw-r--r--. 1 root root  174 Jun 18 17:25 settings.yml
[root@foreman test]# cat /etc/foreman-proxy/settings.yml
--- 
#replace default location of "settings.d" 
:settings_directory: /etc/foreman-proxy/settings.d

:settings_directory: /etc/foreman-proxy/settings.d
:virsh_network: default

Associated revisions

Revision 14fc2ced (diff)
Added by Dominic Cleal almost 5 years ago

fixes #6275 - idempotence needs clone of original data and to handle *_port

History

#1 Updated by Dominic Cleal almost 5 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Dominic Cleal
  • Target version set to 1.8.1
  • Legacy Backlogs Release (now unused) set to 10

#2 Updated by Dominic Cleal almost 5 years ago

  • Priority changed from Urgent to Normal

RPM spec updated to avoid triggering this, debs will too.

#3 Updated by Dmitri Dolguikh almost 5 years ago

  • Target version changed from 1.8.1 to 1.8.0

#4 Updated by Dominic Cleal almost 5 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF