[yast-commit] [ci_new_pac] JFYI yast2-registration -> sle12
![](https://seccdn.libravatar.org/avatar/af626ca29b1318211e3f416634b5db76.jpg?s=120&d=mm&r=g)
Script 'mail_helper' called by ro
Hello packager,
This is just FYI. Your package was checked in in distribution "sle12"
by autobuild-member: ro.
Here comes the log...
---------------------------%<------------------------------
Hi,
here is the log from ci_new_pac /mounts/work_src_done/SLE12/yast2-registration -> sle12
Changes:
--------
--- /work/SRC/SUSE:SLE-12:GA/yast2-registration/yast2-registration.changes 2014-01-28 14:13:58.000000000 +0100
+++ /mounts/work_src_done/SLE12/yast2-registration/yast2-registration.changes 2014-02-04 18:12:01.000000000 +0100
@@ -1,0 +2,6 @@
+Mon Feb 3 20:00:19 UTC 2014 - lslezak@suse.cz
+
+- use scc_api gem for communication with SCC
+- 3.1.3
+
+-------------------------------------------------------------------
calling whatdependson for sle12-i586
Packages directly triggered for rebuild:
- yast2-registration
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/SUSE:SLE-12:GA/yast2-registration (Old)
and /mounts/work_src_done/SLE12/yast2-registration (BS:build ID:31640 MAIL:yast-commit@opensuse.org) (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-registration", Maintainer is "yast-commit@opensuse.org"
Old:
----
yast2-registration-3.1.2.tar.bz2
New:
----
yast2-registration-3.1.3.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-registration.spec ++++++
--- /var/tmp/diff_new_pack.Zp5r4X/_old 2014-02-05 17:48:14.000000000 +0100
+++ /var/tmp/diff_new_pack.Zp5r4X/_new 2014-02-05 17:48:14.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-registration
-Version: 3.1.2
+Version: 3.1.3
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -28,9 +28,10 @@
Requires: yast2 >= 2.23.13
Requires: yast2-pkg-bindings >= 2.17.20
-Requires: yast2-ruby-bindings >= 1.0.0
-# provides "lscpu"
-Requires: util-linux
+# Y2Logger
+Requires: yast2-ruby-bindings >= 3.1.7
+# SCC API library
+Requires: rubygem-scc_api
BuildRequires: yast2 >= 2.23.13
BuildRequires: update-desktop-files
@@ -63,9 +64,6 @@
%defattr(-,root,root)
%{yast_desktopdir}/customer_center.desktop
%{yast_clientdir}/*.rb
-%dir %{yast_libdir}
-%dir %{yast_libdir}/registration
-%{yast_libdir}/registration/*.rb
%doc %{yast_docdir}
%changelog
++++++ yast2-registration-3.1.2.tar.bz2 -> yast2-registration-3.1.3.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.2/package/yast2-registration.changes new/yast2-registration-3.1.3/package/yast2-registration.changes
--- old/yast2-registration-3.1.2/package/yast2-registration.changes 2014-01-28 10:10:46.000000000 +0100
+++ new/yast2-registration-3.1.3/package/yast2-registration.changes 2014-02-04 18:10:36.000000000 +0100
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Mon Feb 3 20:00:19 UTC 2014 - lslezak@suse.cz
+
+- use scc_api gem for communication with SCC
+- 3.1.3
+
+-------------------------------------------------------------------
Mon Jan 27 15:11:17 UTC 2014 - lslezak@suse.cz
- added "Skip Registration" button (FATE#312925)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.2/package/yast2-registration.spec new/yast2-registration-3.1.3/package/yast2-registration.spec
--- old/yast2-registration-3.1.2/package/yast2-registration.spec 2014-01-28 10:10:46.000000000 +0100
+++ new/yast2-registration-3.1.3/package/yast2-registration.spec 2014-02-04 18:10:36.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-registration
-Version: 3.1.2
+Version: 3.1.3
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -28,9 +28,10 @@
Requires: yast2 >= 2.23.13
Requires: yast2-pkg-bindings >= 2.17.20
-Requires: yast2-ruby-bindings >= 1.0.0
-# provides "lscpu"
-Requires: util-linux
+# Y2Logger
+Requires: yast2-ruby-bindings >= 3.1.7
+# SCC API library
+Requires: rubygem-scc_api
BuildRequires: yast2 >= 2.23.13
BuildRequires: update-desktop-files
@@ -63,9 +64,6 @@
%defattr(-,root,root)
%{yast_desktopdir}/customer_center.desktop
%{yast_clientdir}/*.rb
-%dir %{yast_libdir}
-%dir %{yast_libdir}/registration
-%{yast_libdir}/registration/*.rb
%doc %{yast_docdir}
%changelog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.2/src/Makefile.am new/yast2-registration-3.1.3/src/Makefile.am
--- old/yast2-registration-3.1.2/src/Makefile.am 2014-01-28 10:10:46.000000000 +0100
+++ new/yast2-registration-3.1.3/src/Makefile.am 2014-02-04 18:10:36.000000000 +0100
@@ -4,15 +4,9 @@
clients/inst_scc.rb \
clients/scc.rb
-ylibdir = @ylibdir@/registration
-ylib_DATA = \
- lib/registration/scc_client.rb \
- lib/registration/scc_credentials.rb \
- lib/registration/scc_hw_detection.rb
-
desktop_DATA = \
desktop/customer_center.desktop
-EXTRA_DIST = $(client_DATA) $(ylib_DATA) $(desktop_DATA)
+EXTRA_DIST = $(client_DATA) $(desktop_DATA)
include $(top_srcdir)/Makefile.am.common
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.2/src/clients/inst_scc.rb new/yast2-registration-3.1.3/src/clients/inst_scc.rb
--- old/yast2-registration-3.1.2/src/clients/inst_scc.rb 2014-01-28 10:10:46.000000000 +0100
+++ new/yast2-registration-3.1.3/src/clients/inst_scc.rb 2014-02-04 18:10:36.000000000 +0100
@@ -22,10 +22,13 @@
# Summary: Ask user for the SCC credentials
#
-require "registration/scc_client.rb"
+# use external rubygem for SCC communication
+require "scc_api"
module Yast
class InstSccClient < Client
+ include Yast::Logger
+
def main
Yast.import "UI"
Yast.import "Pkg"
@@ -38,6 +41,9 @@
Yast.import "Report"
Yast.import "Mode"
+ # redirect the scc_api log to y2log
+ SccApi::GlobalLogger.instance.log = Y2Logger.instance
+
show_scc_credentials_dialog
ret = nil
@@ -53,7 +59,7 @@
begin
register(email, reg_code)
rescue Exception => e
- Builtins.y2error("SCC registration failed: #{e}, #{e.backtrace}")
+ log.error("SCC registration failed: #{e}, #{e.backtrace}")
# TODO: display error details
Report.Error(_("Registration failed."))
ret = nil
@@ -71,7 +77,7 @@
private
def register(email, reg_code)
- scc = SccClient.new(email, reg_code)
+ scc = SccApi::Connection.new(email, reg_code)
# announce (register the system) first
begin
@@ -87,7 +93,7 @@
# there will be just one base product, but theoretically there can be more...
selected_base_products.each do |base_product|
- Builtins.y2milestone("Registering base product: #{base_product.inspect}")
+ log.info("Registering base product: #{base_product.inspect}")
result = scc.register(base_product)
# TODO: remove this
@@ -142,7 +148,7 @@
# filter out not needed data
product_info = selected_base_products.map{|p| { "name" => p["name"], "arch" => p["arch"], "version" => p["version"]}}
- Builtins.y2milestone("Found selected base products: #{product_info}")
+ log.info("Found selected base products: #{product_info}")
product_info
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.2/src/lib/registration/scc_client.rb new/yast2-registration-3.1.3/src/lib/registration/scc_client.rb
--- old/yast2-registration-3.1.2/src/lib/registration/scc_client.rb 2014-01-28 10:10:46.000000000 +0100
+++ new/yast2-registration-3.1.3/src/lib/registration/scc_client.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,163 +0,0 @@
-# encoding: utf-8
-
-require "yast"
-require "registration/scc_hw_detection"
-require "registration/scc_credentials"
-
-require "json"
-
-# network related libs
-require "uri"
-require "net/http"
-require "socket"
-
-module Yast
-
- # TODO FIXME: add Yardoc comments
- class SccClient
-
- attr_accessor :url, :email, :reg_code, :insecure, :credentials
-
- # FIXME: internal testing SCC instance, change to the public production server later
- DEFAULT_SCC_URL = "http://10.122.166.25:3000/connect"
-
- MAX_REDIRECTS = 10
-
- JSON_HTTP_HEADER = {
- # TODO FIXME: a workaround for SCC not accepting JSON input,
- # remove when JSON is correctly supported and use this instead:
- # "Content-Type" => "application/json",
- "Content-Type" => "application/x-www-form-urlencoded",
- "Accept" => "application/json"
- }
-
- def initialize(email, reg_code)
- self.url = DEFAULT_SCC_URL
- self.insecure = false
- self.email = email
- self.reg_code = reg_code
- end
-
- # initial registration via API
- def announce
- body = {
- "email" => email,
- "hostname" => Socket.gethostname,
- "hwinfo" => {
- # TODO FIXME: check the expected structure
- "sockets" => SccHwDetection.cpu_sockets,
- "graphics" => SccHwDetection.gfx_vendor
- }
- }.to_json
-
- Builtins.y2milestone("Sending announce data: #{body}")
-
- # see https://github.com/SUSE/happy-customer/wiki/Connect-API#wiki-sys_create
- # TODO FIXME: set "Accept-Language" HTTP header to set the language
- # used for error messages
-
- params = {
- :url => URI(url + "/announce"),
- :headers => {"Authorization" => "Token token=\"#{reg_code}\""},
- # TODO FIXME: a workaround for SCC not accepting JSON input
- :body => "payload=#{URI.escape body}",
- :method => :post
- }
-
- result = json_http_handler(params)
-
- self.credentials = SccCredentials.new(result["login"], result["password"])
- end
-
- def register(base_product)
- Builtins.y2milestone("Registering base product: #{base_product.inspect}")
-
- body = {
- "token" => reg_code,
- "product_ident" => base_product["name"],
- "product_version" => base_product["version"],
- "arch" => base_product["arch"]
- }.to_json
-
- params = {
- :url => URI(url + "/activate"),
- # TODO FIXME: a workaround for SCC not accepting JSON input
- :body => "payload=#{URI.escape body}",
- :method => :post,
- :credentials => credentials
- }
-
- json_http_handler(params)
- end
-
- private
-
- # generic HTTP(S) transfer for JSON requests/responses
- # TODO: proxy support? (http://apidock.com/ruby/Net/HTTP)
- def json_http_handler(params, redirect_count = MAX_REDIRECTS)
- raise "Reached maximum number of HTTP redirects, aborting" if redirect_count == 0
-
- target_url = params[:url]
- raise "URL parameter missing" unless target_url
-
- headers = params[:headers] || {}
- body = params[:body] || ""
- method = params[:method] || :get
-
- http = Net::HTTP.new(target_url.host, target_url.port)
-
- # switch to HTTPS connection
- if target_url.is_a? URI::HTTPS
- http.use_ssl = true
- http.verify_mode = insecure ? OpenSSL::SSL::VERIFY_NONE : OpenSSL::SSL::VERIFY_PEER
- Builtins.y2security("Warning: SSL certificate verification disabled") if insecure
- else
- Builtins.y2security("Warning: Using insecure \"#{target_url.scheme}\" transfer protocol")
- end
-
- case method
- when :post then
- request = Net::HTTP::Post.new(target_url.request_uri)
- when :put then
- request = Net::HTTP::Put.new(target_url.request_uri)
- when :get then
- request = Net::HTTP::Get.new(target_url.request_uri)
- else
- raise "Unsupported HTTP method: #{method}"
- end
-
- JSON_HTTP_HEADER.merge(headers).each {|k,v| request[k] = v}
- request.body = body
-
- # use Basic Auth if credentials are present
- if params[:credentials]
- request.basic_auth(params[:credentials].username, params[:credentials].password)
- end
-
- response = http.request(request)
-
- case response
- when Net::HTTPSuccess then
- # FIXME: better test the type, this looks fragile...
- if response["content-type"] == "application/json; charset=utf-8"
- Builtins.y2milestone("SCC request succeeded")
- return JSON.parse(response.body)
- else
- raise RuntimeError, "Unexpected content-type: #{response['content-type']}"
- end
- when Net::HTTPRedirection then
- location = response['location']
- params[:url] = URI(location)
- Builtins.y2milestone("Redirected to #{location}")
-
- # retry recursively
- json_http_handler(params, redirect_count - 1)
- else
- # TODO error handling
- Builtins.y2error("HTTP Error: #{response.inspect}")
- raise "HTTP failed: #{response.code}: #{response.message}"
- end
- end
-
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.2/src/lib/registration/scc_credentials.rb new/yast2-registration-3.1.3/src/lib/registration/scc_credentials.rb
--- old/yast2-registration-3.1.2/src/lib/registration/scc_credentials.rb 2014-01-28 10:10:46.000000000 +0100
+++ new/yast2-registration-3.1.3/src/lib/registration/scc_credentials.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,57 +0,0 @@
-# encoding: utf-8
-
-
-require "fileutils"
-
-module Yast
-
- # TODO FIXME: add Yardoc comments
- class SccCredentials
-
- attr_accessor :username, :password
-
- DEFAULT_CREDENTIALS_FILE = "/etc/zypp/credentials.d/SCCcredentials"
-
- def initialize(user, password)
- self.username = user
- self.password = password
- end
-
- def self.read_file(file = DEFAULT_CREDENTIALS_FILE)
- content = File.read(file)
-
- user, passwd = parse_credentials(content)
- SccCredentials.new(user, passwd)
- end
-
- def write_file(file = DEFAULT_CREDENTIALS_FILE)
- # create the target directory if it is missing
- dirname = File.dirname(file)
- FileUtils.mkdir_p(dirname) unless File.exist?(dirname)
-
- File.write(file, serialize)
- end
-
- private
-
- def self.parse_credentials(input)
- user = nil
- passwd = nil
-
- if input.match /^\s*username\s*=\s*(\S+)\s*$/
- user = $1
- end
-
- if input.match /^\s*password\s*=\s*(\S+)\s*$/
- passwd = $1
- end
-
- return [ user, passwd ]
- end
-
- def serialize
- "username=#{username}\npassword=#{password}\n"
- end
-
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.2/src/lib/registration/scc_hw_detection.rb new/yast2-registration-3.1.3/src/lib/registration/scc_hw_detection.rb
--- old/yast2-registration-3.1.2/src/lib/registration/scc_hw_detection.rb 2014-01-28 10:10:46.000000000 +0100
+++ new/yast2-registration-3.1.3/src/lib/registration/scc_hw_detection.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,50 +0,0 @@
-# encoding: utf-8
-
-require "yast"
-
-module Yast
-
- # TODO FIXME: add Yardoc comments
- class SccHwDetection
-
- # the most important are ATI and nVidia for which we can offer driver
- # repositories, the rest is not important
- VENDOR_ID_MAPPING = {
- 0x1002 => "ati",
- 0x10de => "nvidia",
- 0x8086 => "intel"
- }
-
- UNKNOWN_VENDOR = "unknown"
-
- def self.cpu_sockets
- lc_all_bak = ENV["LC_ALL"]
- # run "lscpu" in "C" locale to suppress translations
- ENV["LC_ALL"] = "C"
- ret = `lscpu`
-
- if ret.match /^Socket\(s\):\s*(\d+)\s*$/
- Builtins.y2milestone("Detected CPU sockets: #{$1}")
- return $1.to_i
- else
- raise "CPU detection failed"
- end
- ensure
- ENV["LC_ALL"] = lc_all_bak
- end
-
- def self.gfx_vendor
- display_list = SCR.Read(Path.new(".probe.display"))
- return UNKNOWN_VENDOR if display_list.nil? || display_list.empty?
-
- # use only lower 16 bits for vendor ID, the higher bits contain
- # bus prefix (see TAG_* values, ID_VALUE() and MAKE_ID() macros in
participants (1)
-
ro