ref: refs/heads/master
commit 1077c6401d140f8f2065dc75599a93bbf40d6436
Author: J. Daniel Schmidt
Date: Sat Nov 14 04:16:38 2009 +0100
adaptions for the fix of the internal server error (bnc#553244), version 0.0.7
---
plugins/registration/app/models/register.rb | 60 +++++++++++---------
.../package/yast2-webservice-registration.changes | 6 ++
.../package/yast2-webservice-registration.spec | 6 +-
3 files changed, 42 insertions(+), 30 deletions(-)
diff --git a/plugins/registration/app/models/register.rb b/plugins/registration/app/models/register.rb
index 64e557c..dd008d1 100644
--- a/plugins/registration/app/models/register.rb
+++ b/plugins/registration/app/models/register.rb
@@ -102,6 +102,7 @@ class Register
end
def status_to_xml( options = {} )
+ find
xml = options[:builder] ||= Builder::XmlMarkup.new(options)
xml.instruct! unless options[:skip_instruct]
@@ -111,6 +112,7 @@ class Register
end
def config_to_xml( options = {} )
+ find
xml = options[:builder] ||= Builder::XmlMarkup.new(options)
xml.instruct! unless options[:skip_instruct]
@@ -127,6 +129,7 @@ class Register
end
def to_xml( options = {} )
+ find
xml = options[:builder] ||= Builder::XmlMarkup.new(options)
xml.instruct! unless options[:skip_instruct]
@@ -153,15 +156,15 @@ class Register
case item
when Hash, HashWithIndifferentAccess
- tasklist_hash[item['alias']] = item if item.has_key?('alias')
+ tasklist_hash[item['ALIAS']] = item if item.has_key?('ALIAS')
when Array
item.each do |i|
- tasklist_hash[i['alias']] = i if i.has_key?('alias')
+ tasklist_hash[i['ALIAS']] = i if i.has_key?('ALIAS')
end
end
- changedrepos = tasklist_hash.reject { | k, v | !v.kind_of?(Hash) || v['type'] != 'zypp' }
- changedservices = tasklist_hash.reject { | k, v | !v.kind_of?(Hash) || v['type'] != 'nu' }
+ changedrepos = tasklist_hash.reject { | k, v | !v.kind_of?(Hash) || v['TYPE'] != 'zypp' }
+ changedservices = tasklist_hash.reject { | k, v | !v.kind_of?(Hash) || v['TYPE'] != 'nu' }
end
@@ -173,7 +176,7 @@ class Register
xml.exitcode exitcode
xml.guid self.guid || ''
- if @arguments
+ if @arguments && exitcode != 0
xml.missingarguments({:type => "array"}) do
@arguments.each do | k, v |
if k && v.kind_of?(Hash)
@@ -191,13 +194,13 @@ class Register
if changedrepos && changedrepos.size > 0
xml.changedrepos({:type => "array"}) do
changedrepos.each do | k, v |
- if k && v.kind_of?(Hash) && v.has_key?('task') && v['task'] != "le" && v['task'] != "ld" #only changed repos
+ if k && v && v.kind_of?(Hash) && v.has_key?('TASK') && v['TASK'] != "le" && v['TASK'] != "ld" #only changed repos
xml.repo do
- xml.name v['alias'] || ''
- xml.alias v['alias'] || ''
- xml.type v['type'] || ''
- xml.url v['url'] || ''
- xml.status tasknic[ v['task'] ] || ''
+ xml.name v['ALIAS'] || ''
+ xml.alias v['ALIAS'] || ''
+ xml.type v['TYPE'] || ''
+ xml.url v['URL'] || ''
+ xml.status tasknic[ v['TASK'] ] || ''
end
end
end
@@ -208,29 +211,32 @@ class Register
changedservices.each do | k, v |
if k && v.kind_of?(Hash)
xml.service do
- xml.name v['alias'] || ''
- xml.alias v['alias'] || ''
- xml.type v['type'] || ''
- xml.url v['url'] || ''
- xml.status tasknic[ v['task'] ] || ''
- if v['catalogs']
+ xml.name v['ALIAS'] || ''
+ xml.alias v['ALIAS'] || ''
+ xml.type v['TYPE'] || ''
+ xml.url v['URL'] || ''
+ xml.status tasknic[ v['TASK'] ] || ''
+ if v['CATALOGS']
xml.catalogs do
- if v['catalogs'].kind_of?(Array)
- v['catalogs'].each { |l|
+ if v['CATALOGS'].kind_of?(Hash) && v['CATALOGS']['catalog'] && v['CATALOGS']['catalog'].kind_of?(Array) && v['CATALOGS']['catalog'].size > 0
+ v['CATALOGS']['catalog'].each do |l|
if l && l.kind_of?(Hash)
xml.catalog do
- xml.name l['name'] || ''
- xml.alias l['alias'] || ''
- xml.status tasknic[ l['task'] ] || ''
+ xml.name l['NAME'] || ''
+ xml.alias l['ALIAS'] || ''
+ xml.status tasknic[ l['TASK'] ] || ''
end
end
- }
- else #It is an hash only. This is produced by hash.form_xml if catalogs contains ONE entry only
+ end
+ #It is an hash only. This is produced by hash.form_xml if catalogs contains ONE entry only
+ elsif v['CATALOGS'].kind_of?(Hash) && v['CATALOGS']['catalog'] && v['CATALOGS']['catalog'].kind_of?(Hash)
xml.catalog do
- xml.name v['catalogs']['name'] || ''
- xml.alias v['catalogs']['alias'] || ''
- xml.status tasknic[ v['catalogs']['task'] ] || ''
+ xml.name v['CATALOGS']['catalog']['NAME'] || ''
+ xml.alias v['CATALOGS']['catalog']['ALIAS'] || ''
+ xml.status tasknic[ v['CATALOGS']['catalog']['TASK'] ] || ''
end
+ else
+ xml.catalog ''
end
end
end # catalogs
diff --git a/plugins/registration/package/yast2-webservice-registration.changes b/plugins/registration/package/yast2-webservice-registration.changes
index b4289a5..0553e0b 100644
--- a/plugins/registration/package/yast2-webservice-registration.changes
+++ b/plugins/registration/package/yast2-webservice-registration.changes
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Sat Nov 14 04:00:37 CET 2009 - jdsn@suse.de
+
+- adaptions for the fix of the internal server error (bnc#553244)
+- version 0.0.7
+
+-------------------------------------------------------------------
Fri Nov 13 14:04:04 UTC 2009 - jreidinger@novell.com
- adapt to rename of policykit granting script (bnc#554946)
diff --git a/plugins/registration/package/yast2-webservice-registration.spec b/plugins/registration/package/yast2-webservice-registration.spec
index 499a448..a4424d0 100644
--- a/plugins/registration/package/yast2-webservice-registration.spec
+++ b/plugins/registration/package/yast2-webservice-registration.spec
@@ -14,7 +14,7 @@ PreReq: yast2-webservice
License: GPL v2 only
Group: Productivity/Networking/Web/Utilities
Autoreqprov: on
-Version: 0.0.6
+Version: 0.0.7
Release: 0
Summary: YaST2 - Webservice - Registration
Source: www.tar.bz2
@@ -25,10 +25,10 @@ BuildRequires: rubygem-mocha
# YaST2/modules/YSR.pm
%if 0%{?suse_version} == 0 || %suse_version > 1110
# 11.2 or newer
-Requires: yast2-registration > 2.18.1
+Requires: yast2-registration > 2.18.2
%else
# 11.1 or SLES11
-Requires: yast2-registration > 2.17.26
+Requires: yast2-registration > 2.17.27
%endif
#
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org