Fixes #20239 - Add upgrade script for qpid path #518
Conversation
|
Issues: #20239 |
| # rubocop:disable Style/MultipleComparison | ||
| def upgrade_qpid_paths | ||
| qpid_dir = '/var/lib/qpidd' | ||
| qpid_data_dir = "#{qpid_dir}/.qpidd" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works well on RHEL7. For RHEL6:
qpid_data_dir = "#{qpid_dir}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to address this with a downstream MR since upstream is only supporting EL7
hooks/pre/30-upgrade.rb
Outdated
| next if item == '.' || item == '..' | ||
| Kafo::Helpers.execute("puts Moving #{item}") | ||
| Kafo::Helpers.execute("mv #{qpid_dir}/#{item} #{qpid_linearstore}/p001/efp/2048k/in_use/#{item}") | ||
| Kafo::Helpers.execute("ln -s #{qpid_linearstore}/p001/efp/2048k/in_use/#{item} #{qpid_linearstore}/jrnl2/#{item}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two lines need to be performed in a loop over the #{qpid_linearstore}/jrnl/#{item} directory - for every file in this directory, move it to in_use dir, and create a symlink to it. So something like:
Dir.foreach("#{qpid_linearstore}/jrnl/#{item}") do |jrnlfile|
Kafo::Helpers.execute("mv #{qpid_linearstore}/jrnl/#{item}/#{jrnlfile} #{qpid_linearstore}/p001/efp/2048k/in_use/#{jrnlfile}")
Kafo::Helpers.execute("ln -s #{qpid_linearstore}/p001/efp/2048k/in_use/#{jrnlfile} #{qpid_linearstore}/jrnl2/#{item}/#{jrnlfile}")
end
hooks/pre/30-upgrade.rb
Outdated
| @@ -157,6 +187,7 @@ def fail_and_exit(message) | |||
| upgrade_step :start_httpd, :run_always => true | |||
| upgrade_step :start_qpidd, :run_always => true | |||
| upgrade_step :start_pulp, :run_always => true | |||
| upgrade_step :upgrade_qpid_paths | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont know how the upgrade steps are ordered, but the upgrade_qpid_paths must be run when qpidd is stopped (so when it is recommended to have stopped also pulp or candlepin and so).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, will change that around to have it done before anything is running
hooks/pre/30-upgrade.rb
Outdated
| # Move qpid jrnl files | ||
| Dir.foreach("#{qpid_linearstore}/jrnl") do |item| | ||
| next if item == '.' || item == '..' | ||
| Kafo::Helpers.execute("puts Moving #{item}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want the puts to just be a line and not wrapped in execute
|
What happens if any step fails? Should we consider a rescue to catch errors and spit out a more friendly error followed by any backtrace associated to a failure? |
|
Looks good. |
Commit enables passing --kickstart-repository and --content-source options to hammer host create/update hammer hostgroup create/update
No description provided.