commit hawk for openSUSE:Factory
Hello community, here is the log from the commit of package hawk for openSUSE:Factory checked in at 2012-12-28 15:01:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/hawk (Old) and /work/SRC/openSUSE:Factory/.hawk.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "hawk", Maintainer is "TSerong@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/hawk/hawk.changes 2012-06-25 11:46:50.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.hawk.new/hawk.changes 2012-12-28 15:01:11.000000000 +0100 @@ -1,0 +2,29 @@ +Sat Dec 22 05:32:25 UTC 2012 - tserong@suse.com + +- Port to rails 3 + +------------------------------------------------------------------- +Mon Dec 10 04:42:52 UTC 2012 - tserong@suse.com + +- Misc: Cib model: Ignore 'ha' field from node state (dropped in pacemaker) +- Misc: Invoker: Handle new value of cib_NOTEXISTS (was -22, now -6) +- Misc: CibObject: Handle emtpy cibadmin output when object doesn't exist +- Misc: Primitive model: Use new lrmd_test for RA metadata if present +- Misc: Set sensible default $HOME in ApplicationController + +------------------------------------------------------------------- +Mon Dec 10 03:29:46 UTC 2012 - tserong@suse.com + +- Misc: Util: Use user's real $HOME with fallback to per-user temp (bnc#780973) +- GUI: Constraints: Use !empty? instead of String#any? (ruby 1.9 support) +- Upstream version cs:c9cfa96 + +------------------------------------------------------------------- +Mon Jul 9 07:47:18 UTC 2012 - tserong@suse.com + +- GUI: jQuery: Fix AJAX memory leak in IE8 (bnc#764273) +- GUI: summary_view: Fix IE JS error on detail pane update (bnc#765625) +- GUI: Primitive editor: Handle RA metadata with missing longdesc (bnc#769724) +- Upstream version cs:abfe94a + +------------------------------------------------------------------- Old: ---- fix-rails-freeze-version_requirements.patch require-rack-1.1.patch ruby-1.9-hash.patch ruby-1.9-when.patch New: ---- bundler.patch dispatch.patch fix-cib-NOTEXISTS.patch fix-cibobject-exists.patch fix-root.patch precompile.patch remove-Gemfile-lock.patch remove-ha_state.patch session-old-hash.patch set-default-home.patch use-lrmd_test.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hawk.spec ++++++ --- /var/tmp/diff_new_pack.x5OS9d/_old 2012-12-28 15:01:12.000000000 +0100 +++ /var/tmp/diff_new_pack.x5OS9d/_new 2012-12-28 15:01:12.000000000 +0100 @@ -34,10 +34,17 @@ Source: %{name}-%{version}.tar.bz2 Source1: filter-requires.sh Source100: hawk-rpmlintrc -Patch2: require-rack-1.1.patch -Patch5: fix-rails-freeze-version_requirements.patch -Patch10: ruby-1.9-when.patch -Patch11: ruby-1.9-hash.patch +Patch0: remove-Gemfile-lock.patch +Patch3: remove-ha_state.patch +Patch4: fix-cib-NOTEXISTS.patch +Patch5: use-lrmd_test.patch +Patch6: set-default-home.patch +Patch7: fix-cibobject-exists.patch +Patch8: session-old-hash.patch +Patch9: bundler.patch +Patch10: fix-root.patch +Patch11: precompile.patch +Patch12: dispatch.patch %define _use_internal_dependency_generator 0 %define __find_requires /bin/sh %{SOURCE1} BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -51,25 +58,28 @@ Requires: graphviz-gd Requires: lighttpd >= 1.4.20 Requires: ruby +Requires: ruby +Requires: rubygem-bundler %if 0%{?suse_version} < 1220 BuildRequires: ruby-fcgi %else -Requires: rubygem-rack-1_1 Requires: rubygem-ruby-fcgi %endif Recommends: graphviz-gnome BuildRequires: glib2-devel BuildRequires: libxml2-devel BuildRequires: pam-devel -BuildRequires: rubygem-gettext_rails +BuildRequires: rubygem-fast_gettext +BuildRequires: rubygem-gettext +BuildRequires: rubygem-gettext_i18n_rails BuildRequires: rubygem-rake BuildRequires: rubygems PreReq: permissions BuildRequires: fdupes BuildRequires: libpacemaker-devel -BuildRequires: rubygem-rails-2_3 -# Temporary, prevents confusion between rubygem-rack and rubygem-rack-1_3 -BuildRequires: rubygem-rack < 1.3 +BuildRequires: rubygem-rack +BuildRequires: rubygem-rails-3_2 +BuildRequires: rubygem-rails-i18n # Require startproc respecting -p, bnc#559534#c44 %if 0%{?suse_version} > 1110 # 11.2 or newer; @@ -100,10 +110,17 @@ %prep %setup -%patch2 -p0 -%patch5 -p0 +%patch0 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 %patch10 -p1 %patch11 -p1 +%patch12 -p1 %build CFLAGS="${CFLAGS} ${RPM_OPT_FLAGS}" @@ -114,28 +131,6 @@ make WWW_BASE=%{www_base} INIT_STYLE=%{init_style} DESTDIR=%{buildroot} install # copy of GPL cp COPYING %{buildroot}%{www_base}/hawk/ -%if 0%{?suse_version} < 1220 -# note: only doing evil magic pre-openSUSE 12.2 -# evil magic to get ruby-fcgi into the vendor directory -for f in $(rpm -ql ruby-fcgi|grep %{vendor_ruby}); do - # gives something simliar to: - # /usr/lib64/ruby/vendor_ruby/1.8/fcgi.rb - # /usr/lib64/ruby/vendor_ruby/1.8/x86_64-linux/fcgi.so - r=$(echo $f | sed 's/.*%{vendor_ruby}\/[^\/]*\///') - mkdir -p %{buildroot}%{www_base}/hawk/vendor/$(dirname $r) - cp $f %{buildroot}%{www_base}/hawk/vendor/$r -done -# even more evil magic to get rubygems into the vendor directory -for f in $(rpm -ql rubygems|grep %{vendor_ruby}); do - # gives something simliar to: - # /usr/lib64/ruby/vendor_ruby/1.8/rubygems.rb - # /usr/lib64/ruby/vendor_ruby/1.8/rubygems/... - [ -f $f ] || continue - r=$(echo $f | sed 's/.*%{vendor_ruby}\/[^\/]*\///') - mkdir -p %{buildroot}%{www_base}/hawk/vendor/$(dirname $r) - cp $f %{buildroot}%{www_base}/hawk/vendor/$r -done -%endif # get rid of gem sample and test cruft rm -rf %{buildroot}%{www_base}/hawk/vendor/gems/*/sample rm -rf %{buildroot}%{www_base}/hawk/vendor/gems/*/samples @@ -144,17 +139,17 @@ # mark .mo files as such (works on SUSE but not FC12, as the latter wants directory to # be "share/locale", not just "locale", and it also doesn't support appending to %%{name}.lang) %find_lang %{name} %{name}.lang -%find_lang rgettext %{name}.lang -%find_lang gettext_rails %{name}.lang +#%find_lang rgettext %{name}.lang +#%find_lang gettext_rails %{name}.lang # hard link duplicate files %fdupes %{buildroot} # more cruft to clean up (WTF?) rm -f %{buildroot}%{www_base}/hawk/log/* -find %{buildroot}%{www_base}/hawk/vendor/rails -type f -name '*.css' -o -name '*.js' -o -name '*LICENSE' | xargs chmod a-x +#find %{buildroot}%{www_base}/hawk/vendor/rails -type f -name '*.css' -o -name '*.js' -o -name '*LICENSE' | xargs chmod a-x # get rid of packed gem specification files rm -f %{buildroot}%{www_base}/hawk/vendor/gems/*/.specification # likewise emtpy files (again, I say, WTF?) -find %{buildroot}%{www_base}/hawk/vendor -type f -empty | xargs rm +find %{buildroot}%{www_base}/hawk/vendor -type f -empty -print0 | xargs -0 rm # init script %{__install} -d -m 0755 \ %{buildroot}%{_sbindir} @@ -204,10 +199,16 @@ %attr(0750, %{uname},%{gname})%{www_base}/hawk/tmp/pids %attr(0750, %{uname},%{gname})%{www_base}/hawk/tmp/sessions %attr(0750, %{uname},%{gname})%{www_base}/hawk/tmp/sockets -%{www_base}/hawk/po +%exclude %{www_base}/hawk/tmp/session_secret +%{www_base}/hawk/locale/hawk.pot +%{www_base}/hawk/.bundle %{www_base}/hawk/public %{www_base}/hawk/Rakefile +%{www_base}/hawk/Gemfile +%{www_base}/hawk/Gemfile.lock %{www_base}/hawk/COPYING +%{www_base}/hawk/README.rdoc +%{www_base}/hawk/config.ru %{www_base}/hawk/script %{www_base}/hawk/test # itemizing content in %%{www_base}/hawk/vendor and locale to avoid @@ -215,26 +216,30 @@ %dir %{www_base}/hawk/locale %dir %{www_base}/hawk/locale/* %dir %{www_base}/hawk/locale/*/* +%exclude %{www_base}/hawk/locale/*/*.po %dir %{www_base}/hawk/vendor %if 0%{?suse_version} < 1220 %{www_base}/hawk/vendor/*rb # architecture-specific .so files %{www_base}/hawk/vendor/*-linux %endif +%{www_base}/hawk/vendor/bundle +%{www_base}/hawk/vendor/cache + # this is moderatly disgusting - the intent is to get everything except # the content of "data/locale" which is covered by files in hawk.lang -%dir %{www_base}/hawk/vendor/gems -%dir %{www_base}/hawk/vendor/gems/* -%dir %{www_base}/hawk/vendor/gems/*/data -%dir %{www_base}/hawk/vendor/gems/*/data/locale -%dir %{www_base}/hawk/vendor/gems/*/data/locale/* -%dir %{www_base}/hawk/vendor/gems/*/data/locale/*/* -%{www_base}/hawk/vendor/gems/*/[!d]* -%{www_base}/hawk/vendor/rails -%if 0%{?suse_version} < 1220 -%{www_base}/hawk/vendor/rbconfig -%{www_base}/hawk/vendor/rubygems -%endif +#%dir %{www_base}/hawk/vendor/gems +#%dir %{www_base}/hawk/vendor/gems/* +#%dir %{www_base}/hawk/vendor/gems/*/data +#%dir %{www_base}/hawk/vendor/gems/*/data/locale +#%dir %{www_base}/hawk/vendor/gems/*/data/locale/* +#%dir %{www_base}/hawk/vendor/gems/*/data/locale/*/* +#%{www_base}/hawk/vendor/gems/*/[!d]* +#%{www_base}/hawk/vendor/rails +#%if 0%{?suse_version} < 1220 +#%{www_base}/hawk/vendor/rbconfig +#%{www_base}/hawk/vendor/rubygems +#%endif %config(noreplace) %attr(-,root,root) %{_sysconfdir}/init.d/hawk %attr(-,root,root) %{_sbindir}/rchawk ++++++ bundler.patch ++++++ Index: hawk-0.5.2/Makefile =================================================================== --- hawk-0.5.2.orig/Makefile +++ hawk-0.5.2/Makefile @@ -60,7 +60,7 @@ BINDIR = /usr/bin SBINDIR = /usr/sbin all: scripts/hawk.$(INIT_STYLE) hawk/config/lighttpd.conf tools/hawk_chkpwd tools/hawk_monitor tools/hawk_invoke - (cd hawk; rake gettext:pack && bundle install --local --deployment) + (cd hawk; rake gettext:pack && bundle list && sed -i -e '/\brake\b/d' -e '/\brdoc\b/d' Gemfile.lock && bundle package && bundle install --deployment) %:: %.in sed \ @@ -114,6 +114,7 @@ install: # Get rid of cruft from packed gems -find hawk/vendor -name '*bak' -o -name '*~' -o -name '#*#' | xargs rm cp -a hawk/* $(DESTDIR)$(WWW_BASE)/hawk + cp -a hawk/.bundle $(DESTDIR)$(WWW_BASE)/hawk rm $(DESTDIR)$(WWW_BASE)/hawk/config/lighttpd.conf.in -chown -R hacluster.haclient $(DESTDIR)$(WWW_BASE)/hawk/log -chown -R hacluster.haclient $(DESTDIR)$(WWW_BASE)/hawk/tmp Index: hawk-0.5.2/hawk/Gemfile =================================================================== --- hawk-0.5.2.orig/hawk/Gemfile +++ hawk-0.5.2/hawk/Gemfile @@ -1,4 +1,4 @@ -source 'https://rubygems.org' +#source 'https://rubygems.org' gem 'rails', '>= 3.2' ++++++ dispatch.patch ++++++ Index: hawk-0.5.2/hawk/public/dispatch.fcgi =================================================================== --- hawk-0.5.2.orig/hawk/public/dispatch.fcgi +++ hawk-0.5.2/hawk/public/dispatch.fcgi @@ -1,29 +1,26 @@ #!/usr/bin/ruby -# -# You may specify the path to the FastCGI crash log (a log of unhandled -# exceptions which forced the FastCGI instance to exit, great for debugging) -# and the number of requests to process before running garbage collection. -# -# By default, the FastCGI crash log is Rails.root/log/fastcgi.crash.log -# and the GC period is nil (turned off). A reasonable number of requests -# could range from 10-100 depending on the memory footprint of your app. -# -# Example: -# # Default log path, normal GC behavior. -# RailsFCGIHandler.process! -# -# # Default log path, 50 requests between GC. -# RailsFCGIHandler.process! nil, 50 -# -# # Custom log path, normal GC behavior. -# RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log' -# -# get the vendor directory into the load path well in advance, so -# we can pull rubygems from there $LOAD_PATH.unshift(File.dirname(__FILE__) + "/../vendor") +require 'rubygems' +require 'fcgi' + +#require_relative '../config/environment' require File.dirname(__FILE__) + "/../config/environment" -require 'fcgi_handler' -RailsFCGIHandler.process! +class Rack::PathInfoRewriter + def initialize(app) + @app = app + end + + def call(env) + env.delete('SCRIPT_NAME') + parts = env['REQUEST_URI'].split('?') + env['PATH_INFO'] = parts[0] + env['QUERY_STRING'] = parts[1].to_s + @app.call(env) + end +end + +Rack::Handler::FastCGI.run Rack::PathInfoRewriter.new(Hawk::Application) + ++++++ fix-cib-NOTEXISTS.patch ++++++ Index: hawk-0.5.2/hawk/lib/invoker.rb =================================================================== --- hawk-0.5.2.orig/hawk/lib/invoker.rb +++ hawk-0.5.2/hawk/lib/invoker.rb @@ -101,7 +101,7 @@ class Invoker case thread.value.exitstatus when 0 return out - when 22 # cib_NOTEXISTS + when 6, 22 # cib_NOTEXISTS (used to be 22, now it's 6...) raise NotFoundError, _('The object/attribute does not exist (cibadmin %{cmd})') % {:cmd => cmd.inspect} when 54 # cib_permission_denied raise SecurityError, _('Permission denied for user %{user}') % {:user => current_user} @@ -123,7 +123,7 @@ class Invoker case thread.value.exitstatus when 0 return true - when 22 # cib_NOTEXISTS + when 6, 22 # cib_NOTEXISTS (used to be 22, now it's 6...) raise NotFoundError, _('The object/attribute does not exist: %{msg}') % {:msg => err} when 54 # cib_permission_denied raise SecurityError, _('Permission denied for user %{user}') % {:user => current_user} ++++++ fix-cibobject-exists.patch ++++++ Index: hawk-0.5.2/hawk/app/models/cib_object.rb =================================================================== --- hawk-0.5.2.orig/hawk/app/models/cib_object.rb +++ hawk-0.5.2/hawk/app/models/cib_object.rb @@ -75,7 +75,8 @@ class CibObject # hacluster, because we need to verify existence regardless of whether # the current user can actually see the object in quesion. def exists?(id, type='*') - Util.safe_x('/usr/sbin/cibadmin', '-Ql', '--xpath', "//configuration//#{type}[@id='#{id}']").chomp != '<null>' + out = Util.safe_x('/usr/sbin/cibadmin', '-Ql', '--xpath', "//configuration//#{type}[@id='#{id}']").chomp + !out.empty? && out != '<null>' end # Find a CIB object by ID and return an instance of the appropriate ++++++ fix-root.patch ++++++ Index: hawk-0.5.2/hawk/app/controllers/application_controller.rb =================================================================== --- hawk-0.5.2.orig/hawk/app/controllers/application_controller.rb +++ hawk-0.5.2/hawk/app/controllers/application_controller.rb @@ -78,7 +78,7 @@ class ApplicationController < ActionCont # Need a default homedir for bare crm invocations that's # writeable by hacluster - ENV['HOME'] = File.join(RAILS_ROOT, 'tmp', 'home') + ENV['HOME'] = File.join(Rails.root, 'tmp', 'home') end # Meant to be protected, but must be public to be called by Invoker ++++++ hawk-0.5.2.tar.bz2 ++++++ ++++ 63732 lines of diff (skipped) ++++++ precompile.patch ++++++ Index: hawk-0.5.2/hawk/config/environments/production.rb =================================================================== --- hawk-0.5.2.orig/hawk/config/environments/production.rb +++ hawk-0.5.2/hawk/config/environments/production.rb @@ -12,10 +12,10 @@ Hawk::Application.configure do config.serve_static_assets = false # Compress JavaScripts and CSS - config.assets.compress = true + config.assets.compress = false # Don't fallback to assets pipeline if a precompiled asset is missed - config.assets.compile = false + config.assets.compile = true # Generate digests for assets URLs config.assets.digest = true ++++++ remove-Gemfile-lock.patch ++++++ Index: hawk-0.5.2/hawk/Gemfile.lock =================================================================== --- hawk-0.5.2.orig/hawk/Gemfile.lock +++ /dev/null @@ -1,97 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - actionmailer (3.2.7) - actionpack (= 3.2.7) - mail (~> 2.4.4) - actionpack (3.2.7) - activemodel (= 3.2.7) - activesupport (= 3.2.7) - builder (~> 3.0.0) - erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.0) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.1.3) - activemodel (3.2.7) - activesupport (= 3.2.7) - builder (~> 3.0.0) - activerecord (3.2.7) - activemodel (= 3.2.7) - activesupport (= 3.2.7) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.7) - activemodel (= 3.2.7) - activesupport (= 3.2.7) - activesupport (3.2.7) - i18n (~> 0.6) - multi_json (~> 1.0) - arel (3.0.2) - builder (3.0.0) - erubis (2.7.0) - fast_gettext (0.6.4) - gettext (2.2.1) - locale - gettext_i18n_rails (0.4.3) - fast_gettext - hike (1.2.1) - i18n (0.6.0) - journey (1.0.4) - json (1.7.1) - locale (2.0.5) - mail (2.4.4) - i18n (>= 0.4.0) - mime-types (~> 1.16) - treetop (~> 1.4.8) - mime-types (1.18) - multi_json (1.3.5) - polyglot (0.3.3) - rack (1.4.1) - rack-cache (1.2) - rack (>= 0.4) - rack-ssl (1.3.2) - rack - rack-test (0.6.1) - rack (>= 1.0) - rails (3.2.7) - actionmailer (= 3.2.7) - actionpack (= 3.2.7) - activerecord (= 3.2.7) - activeresource (= 3.2.7) - activesupport (= 3.2.7) - bundler (~> 1.0) - railties (= 3.2.7) - rails-i18n (0.3.0) - i18n (~> 0.5) - railties (3.2.7) - actionpack (= 3.2.7) - activesupport (= 3.2.7) - rack-ssl (~> 1.3.2) - rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) - rake (0.9.2.2) - rdoc (3.12) - json (~> 1.4) - sprockets (2.1.3) - hike (~> 1.2) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - thor (0.14.6) - tilt (1.1) - treetop (1.4.10) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.33) - -PLATFORMS - ruby - -DEPENDENCIES - fast_gettext - gettext (>= 1.9.3) - gettext_i18n_rails (>= 0.4.3) - rails (>= 3.2) - rails-i18n ++++++ remove-ha_state.patch ++++++ Index: hawk-0.5.2/hawk/app/models/cib.rb =================================================================== --- hawk-0.5.2.orig/hawk/app/models/cib.rb +++ hawk-0.5.2/hawk/app/models/cib.rb @@ -131,7 +131,6 @@ class Cib < CibObject # transliteration of pacemaker/lib/pengine/unpack.c:determine_online_status_fencing() # ns is node_state element from CIB def determine_online_status_fencing(ns) - ha_state = get_xml_attr(ns, 'ha', 'dead') in_ccm = get_xml_attr(ns, 'in_ccm') crm_state = get_xml_attr(ns, 'crmd') join_state = get_xml_attr(ns, 'join') @@ -141,7 +140,7 @@ class Cib < CibObject expected_up = get_xml_attr(ns, 'shutdown', '0') == 0 state = :unclean - if in_ccm && ha_state == 'active' && crm_state == 'online' + if in_ccm && crm_state == 'online' case join_state when 'member' # rock 'n' roll (online) state = :online @@ -154,7 +153,7 @@ class Cib < CibObject else # unexpectedly down (unclean) state = :unclean end - elsif !in_ccm && ha_state =='dead' && crm_state == 'offline' && !expected_up + elsif !in_ccm && crm_state == 'offline' && !expected_up state = :offline # not online, but cleanly elsif expected_up state = :unclean # expected to be up, mark it unclean @@ -168,7 +167,6 @@ class Cib < CibObject # ns is node_state element from CIB # TODO(could): can we consolidate this with determine_online_status_fencing? def determine_online_status_no_fencing(ns) - ha_state = get_xml_attr(ns, 'ha', 'dead') in_ccm = get_xml_attr(ns, 'in_ccm') crm_state = get_xml_attr(ns, 'crmd') join_state = get_xml_attr(ns, 'join') @@ -178,7 +176,7 @@ class Cib < CibObject expected_up = get_xml_attr(ns, 'shutdown', '0') == 0 state = :unclean - if !in_ccm || ha_state == 'dead' + if !in_ccm state = :offline elsif crm_state == 'online' if join_state == 'member' ++++++ session-old-hash.patch ++++++ Index: hawk-0.5.2/hawk/config/initializers/cookie_verification_secret.rb =================================================================== --- hawk-0.5.2.orig/hawk/config/initializers/cookie_verification_secret.rb +++ hawk-0.5.2/hawk/config/initializers/cookie_verification_secret.rb @@ -1,6 +1,6 @@ # Be sure to restart your server when you modify this file. -Hawk::Application.config.session_store :cookie_store, key: '_hawk_session' +Hawk::Application.config.session_store :cookie_store, :key => '_hawk_session' SESSION_SECRET_FILE = File.join(Rails.root, 'tmp', 'session_secret') Index: hawk-0.5.2/hawk/config/initializers/session_store.rb =================================================================== --- hawk-0.5.2.orig/hawk/config/initializers/session_store.rb +++ hawk-0.5.2/hawk/config/initializers/session_store.rb @@ -1,6 +1,6 @@ # Be sure to restart your server when you modify this file. -Hawk::Application.config.session_store :cookie_store, key: '_hawk_session' +Hawk::Application.config.session_store :cookie_store, :key => '_hawk_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information Index: hawk-0.5.2/hawk/config/initializers/wrap_parameters.rb =================================================================== --- hawk-0.5.2.orig/hawk/config/initializers/wrap_parameters.rb +++ hawk-0.5.2/hawk/config/initializers/wrap_parameters.rb @@ -5,7 +5,7 @@ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. ActiveSupport.on_load(:action_controller) do - wrap_parameters format: [:json] + wrap_parameters :format => [:json] end # Disable root element in JSON by default. ++++++ set-default-home.patch ++++++ Index: hawk-0.5.2/hawk/app/controllers/application_controller.rb =================================================================== --- hawk-0.5.2.orig/hawk/app/controllers/application_controller.rb +++ hawk-0.5.2/hawk/app/controllers/application_controller.rb @@ -75,6 +75,10 @@ class ApplicationController < ActionCont require 'socket' @host = Socket.gethostname # should be short hostname + + # Need a default homedir for bare crm invocations that's + # writeable by hacluster + ENV['HOME'] = File.join(RAILS_ROOT, 'tmp', 'home') end # Meant to be protected, but must be public to be called by Invoker ++++++ use-lrmd_test.patch ++++++ Index: hawk-0.5.2/hawk/app/models/primitive.rb =================================================================== --- hawk-0.5.2.orig/hawk/app/models/primitive.rb +++ hawk-0.5.2/hawk/app/models/primitive.rb @@ -327,7 +327,19 @@ class Primitive < CibObject } return m if c.empty? or t.empty? p = 'NULL' if p.empty? - xml = REXML::Document.new(Util.safe_x('/usr/sbin/lrmadmin', '-M', c, t, p, 'meta')) + + xml = nil + + # try pacemaker's new lrmd_test for metadata. + [ "/usr/lib64/pacemaker/lrmd_test", "/usr/lib/pacemaker/lrmd_test" ].each do |path| + next unless File.executable?(path) + xml = REXML::Document.new(Util.safe_x(path, '-c', 'metadata', '-C', c, '-P', p, '-T', t)) + break + end + + # old lrmadmin fallback + xml = REXML::Document.new(Util.safe_x('/usr/sbin/lrmadmin', '-M', c, t, p, 'meta')) unless xml + return m unless xml.root # TODO(should): select by language (en), likewise below m[:shortdesc] = Util.get_xml_text(xml.root.elements['shortdesc']) -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de