Hello community,

here is the log from the commit of package SUSEConnect for openSUSE:Factory 
checked in at 2018-09-26 15:59:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/SUSEConnect (Old)
 and      /work/SRC/openSUSE:Factory/.SUSEConnect.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "SUSEConnect"

Wed Sep 26 15:59:24 2018 rev:14 rq:635718 version:0.3.12

Changes:
--------
--- /work/SRC/openSUSE:Factory/SUSEConnect/SUSEConnect.changes  2018-06-22 
13:14:50.912227389 +0200
+++ /work/SRC/openSUSE:Factory/.SUSEConnect.new/SUSEConnect.changes     
2018-09-26 15:59:26.368700461 +0200
@@ -1,0 +2,14 @@
+Wed Sep  5 12:21:39 UTC 2018 - [email protected]
+
+- Update to 0.3.12
+  - Detect if system is in cloud provider (AWS/Google/Azure)
+    (fate#320935)
+  - Don't fail when trying to parse an empty body. Fixes bsc#1098220
+  - Don't install release packages if they are already present
+
+-------------------------------------------------------------------
+Tue Jun 19 15:58:46 UTC 2018 - [email protected]
+
+- Fix .spec file for running SUSEConnect on Fedora28
+
+-------------------------------------------------------------------

Old:
----
  suse-connect-0.3.11.gem

New:
----
  suse-connect-0.3.12.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ SUSEConnect.spec ++++++
--- /var/tmp/diff_new_pack.TKx8ut/_old  2018-09-26 15:59:27.760698040 +0200
+++ /var/tmp/diff_new_pack.TKx8ut/_new  2018-09-26 15:59:27.764698034 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           SUSEConnect
-Version:        0.3.11
+Version:        0.3.12
 Release:        0
 %define mod_name suse-connect
 %define mod_full_name %{mod_name}-%{version}
@@ -25,7 +25,11 @@
 # Does not build for i586 and s390 and is not supported on those architectures
 ExcludeArch:    %ix86 s390
 
+%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
+Requires:       ca-certificates
+%else
 Requires:       ca-certificates-mozilla
+%endif
 Requires:       coreutils
 Requires:       hwinfo
 Requires:       net-tools
@@ -50,13 +54,17 @@
 Provides:       ruby2.1-rubygem-suse-connect = %{version}
 %endif
 
-%define ruby_version %{rb_default_ruby_suffix}
-# FIXME: For some reason, on SLE15 %{rb_default_ruby_suffix} resolves to 
ruby2.4 which does not exist there
-%if (0%{?sle_version} > 0 && 0%{?sle_version} >= 150000)
+# cross-distribution howto: 
https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto
+%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
 %define ruby_version ruby2.5
-%endif
-
+%global gem_base /usr/share/gems
+%global debug_package %{nil}
+BuildRequires:  ruby
+BuildRequires:  rubygems
+%else
+%define ruby_version %{rb_default_ruby_suffix}
 BuildRequires:  %{ruby_version}
+%endif
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Url:            https://github.com/SUSE/connect
@@ -69,7 +77,8 @@
 Summary:        Utility to register a system with the SUSE Customer Center
 License:        LGPL-2.1
 Group:          System/Management
-Requires(post): update-alternatives
+Requires(post): /usr/sbin/update-alternatives
+
 
 %description
 This package provides a command line tool and rubygem library for connecting a
@@ -84,9 +93,10 @@
 %build
 
 %install
-gem install --verbose --local --build-root=%{buildroot} -f --no-ri --no-rdoc 
./%{mod_full_name}.gem
-mkdir %{buildroot}%{_sbindir}
-mv %{buildroot}%{_bindir}/%{name}.%{ruby_version} 
%{buildroot}%{_sbindir}/%{name}
+mkdir -p %{buildroot}%{_sbindir}
+mkdir -p %{buildroot}%{_bindir}
+gem install --verbose --local --build-root=%{buildroot} --no-user-install 
--bindir %{_bindir} -f --no-ri --no-rdoc ./%{mod_full_name}.gem
+mv %{buildroot}%{_bindir}/%{name}* %{buildroot}%{_sbindir}/%{name}
 ln -s %{_sbindir}/%{name} %{buildroot}%{_bindir}/%{name}
 
 install -D -m 644 %_sourcedir/SUSEConnect.5 
%{buildroot}%_mandir/man5/SUSEConnect.5

++++++ SUSEConnect.5 ++++++
--- /var/tmp/diff_new_pack.TKx8ut/_old  2018-09-26 15:59:27.788697991 +0200
+++ /var/tmp/diff_new_pack.TKx8ut/_new  2018-09-26 15:59:27.792697985 +0200
@@ -1,7 +1,7 @@
 .\" generated with Ronn/v0.7.3
 .\" http://github.com/rtomayko/ronn/tree/0.7.3
 .
-.TH "SUSECONNECT" "5" "March 2018" "" "SUSEConnect"
+.TH "SUSECONNECT" "5" "April 2017" "" "SUSEConnect"
 .
 .SH "NAME"
 \fBSUSEConnect\fR \- SUSE Customer Center registration tool config file

++++++ SUSEConnect.8 ++++++
--- /var/tmp/diff_new_pack.TKx8ut/_old  2018-09-26 15:59:27.804697964 +0200
+++ /var/tmp/diff_new_pack.TKx8ut/_new  2018-09-26 15:59:27.804697964 +0200
@@ -1,7 +1,7 @@
 .\" generated with Ronn/v0.7.3
 .\" http://github.com/rtomayko/ronn/tree/0.7.3
 .
-.TH "SUSECONNECT" "8" "March 2018" "" "SUSEConnect"
+.TH "SUSECONNECT" "8" "June 2017" "" "SUSEConnect"
 .
 .SH "NAME"
 \fBSUSEConnect\fR \- SUSE Customer Center registration tool

++++++ SUSEConnect.example ++++++
--- /var/tmp/diff_new_pack.TKx8ut/_old  2018-09-26 15:59:27.820697936 +0200
+++ /var/tmp/diff_new_pack.TKx8ut/_new  2018-09-26 15:59:27.820697936 +0200
@@ -9,3 +9,6 @@
 
 ## Do not verify SSL certificates when using https (default: false)
 # insecure: false
+
+## Do not refresh zypper service when registering (default: false)
+# no_zypper_refs: false

++++++ suse-connect-0.3.11.gem -> suse-connect-0.3.12.gem ++++++
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/suse/connect/client.rb 
new/lib/suse/connect/client.rb
--- old/lib/suse/connect/client.rb      2018-06-12 12:54:45.000000000 +0200
+++ new/lib/suse/connect/client.rb      2018-09-14 12:15:18.000000000 +0200
@@ -34,11 +34,11 @@
         log.info 'Successfully registered system.'
       end
 
-      # Activate the product, add the service and install the relase package
+      # Activate the product, add the service and install the release package
       def register_product(product, install_release_package = true)
         service = activate_product(product, @config.email)
 
-        System.add_service(service)
+        System.add_service(service, [email protected]_zypper_refs)
         Zypper.install_release_package(product.identifier) if 
install_release_package
 
         print_success_message(product)
@@ -149,19 +149,19 @@
         Remote::Product.new(result)
       end
 
-      # @returns: body described in 
https://github.com/SUSE/connect/wiki/SCC-API-(Implemented)#response-12 and
+      # @returns: body described in 
https://github.com/SUSE/connect/blob/master/doc/SCC-API-(Implemented).md#response-15
 and
       # 200 status code
       def system_services
         @api.system_services(system_auth)
       end
 
-      # @returns: body described in 
https://github.com/SUSE/connect/wiki/SCC-API-(Implemented)#response-13 and
+      # @returns: body described in 
https://github.com/SUSE/connect/blob/master/doc/SCC-API-(Implemented).md#response-19
 and
       # 200 status code
       def system_subscriptions
         @api.system_subscriptions(system_auth)
       end
 
-      # @returns: body described in 
https://github.com/SUSE/connect/wiki/SCC-API-(Implemented)#response-14 and
+      # @returns: body described in 
https://github.com/SUSE/connect/blob/master/doc/SCC-API-(Implemented).md#response-20
 and
       # 200 status code
       def system_activations
         @api.system_activations(system_auth)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/suse/connect/connection.rb 
new/lib/suse/connect/connection.rb
--- old/lib/suse/connect/connection.rb  2018-06-12 12:54:45.000000000 +0200
+++ new/lib/suse/connect/connection.rb  2018-09-14 12:15:18.000000000 +0200
@@ -59,14 +59,14 @@
         request = VERB_TO_CLASS[method].new(path)
         add_headers(request)
 
-        request.body               = params.to_json unless params.empty?
-        response                   = @http.request(request)
-        body                       = JSON.parse(response.body) if response.body
+        request.body  = params.to_json unless params.empty?
+        response      = @http.request(request)
+        response_body = JSON.parse(response.body) unless 
response.body.to_s.empty?
 
         OpenStruct.new(
           code: response.code.to_i,
           headers: response.to_hash,
-          body: body,
+          body: response_body,
           http_message: response.message,
           success: response.is_a?(Net::HTTPSuccess)
         )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/suse/connect/hwinfo/arm64.rb 
new/lib/suse/connect/hwinfo/arm64.rb
--- old/lib/suse/connect/hwinfo/arm64.rb        2018-06-12 12:54:45.000000000 
+0200
+++ new/lib/suse/connect/hwinfo/arm64.rb        2018-09-14 12:15:18.000000000 
+0200
@@ -8,7 +8,8 @@
         sockets: sockets,
         hypervisor: hypervisor,
         arch: arch,
-        uuid: uuid
+        uuid: uuid,
+        cloud_provider: cloud_provider
       }
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/suse/connect/hwinfo/base.rb 
new/lib/suse/connect/hwinfo/base.rb
--- old/lib/suse/connect/hwinfo/base.rb 2018-06-12 12:54:45.000000000 +0200
+++ new/lib/suse/connect/hwinfo/base.rb 2018-09-14 12:15:18.000000000 +0200
@@ -42,6 +42,15 @@
       def arm64?
         arch == 'aarch64'
       end
+
+      def cloud_provider
+        regex = /(Version: .*(amazon)|Manufacturer: (Google)|Manufacturer: 
(Microsoft) Corporation)/
+        matches = execute('dmidecode -t system', 
false).match(regex).to_a[2..4].to_a.compact
+        return nil unless matches.length == 1
+        matches[0].capitalize
+      rescue SUSE::Connect::SystemCallError
+        nil
+      end
     end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/suse/connect/hwinfo/s390.rb 
new/lib/suse/connect/hwinfo/s390.rb
--- old/lib/suse/connect/hwinfo/s390.rb 2018-06-12 12:54:45.000000000 +0200
+++ new/lib/suse/connect/hwinfo/s390.rb 2018-09-14 12:15:18.000000000 +0200
@@ -8,7 +8,8 @@
         sockets: sockets,
         hypervisor: hypervisor,
         arch: arch,
-        uuid: uuid
+        uuid: uuid,
+        cloud_provider: cloud_provider
       }
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/suse/connect/hwinfo/x86.rb 
new/lib/suse/connect/hwinfo/x86.rb
--- old/lib/suse/connect/hwinfo/x86.rb  2018-06-12 12:54:45.000000000 +0200
+++ new/lib/suse/connect/hwinfo/x86.rb  2018-09-14 12:15:18.000000000 +0200
@@ -8,7 +8,8 @@
         sockets: sockets,
         hypervisor: hypervisor,
         arch: arch,
-        uuid: uuid
+        uuid: uuid,
+        cloud_provider: cloud_provider
       }
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/suse/connect/system.rb 
new/lib/suse/connect/system.rb
--- old/lib/suse/connect/system.rb      2018-06-12 12:54:45.000000000 +0200
+++ new/lib/suse/connect/system.rb      2018-09-14 12:15:18.000000000 +0200
@@ -37,9 +37,9 @@
           Zypper.remove_all_suse_services
         end
 
-        def add_service(service)
+        def add_service(service, refresh_zypper_service = true)
           raise ArgumentError, 'only Remote::Service accepted' unless 
service.is_a? Remote::Service
-          Zypper.add_service(service.url, service.name)
+          Zypper.add_service(service.url, service.name, refresh_zypper_service)
           service
         end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/suse/connect/version.rb 
new/lib/suse/connect/version.rb
--- old/lib/suse/connect/version.rb     2018-06-12 12:54:45.000000000 +0200
+++ new/lib/suse/connect/version.rb     2018-09-14 12:15:18.000000000 +0200
@@ -1,5 +1,5 @@
 module SUSE
   module Connect
-    VERSION = '0.3.11'
+    VERSION = '0.3.12'
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/suse/connect/zypper.rb 
new/lib/suse/connect/zypper.rb
--- old/lib/suse/connect/zypper.rb      2018-06-12 12:54:45.000000000 +0200
+++ new/lib/suse/connect/zypper.rb      2018-09-14 12:15:18.000000000 +0200
@@ -84,19 +84,20 @@
           xml_doc.elements.to_a('stream/repo-list/repo').map { |r| 
r.to_hash.merge!(url: r.elements['url'].text) }
         end
 
-        # @param service_url [String] url to appropriate repomd.xml to be fed 
to zypper
+        # @param service_url [String] url to appropriate repoindex.xml to be 
fed to zypper
         # @param service_name [String] Alias-mnemonic with which zypper should 
add this service
         # @return [TrueClass]
         #
+        # @see 
https://doc.opensuse.org/projects/libzypp/HEAD/zypp-services.html#services-remote
 ZYpp Services Documentation
         # @todo TODO: introduce Product class
-        def add_service(service_url, service_name)
+        def add_service(service_url, service_name, refresh_zypper_service = 
true)
           # INFO: Remove old service which could be modified by a customer
           remove_service(service_name)
           call("--non-interactive addservice -t ris 
#{Shellwords.escape(service_url)} '#{Shellwords.escape(service_name)}'")
           enable_service_autorefresh(service_name)
           write_service_credentials(service_name)
 
-          refresh_service(service_name)
+          refresh_service(service_name) if refresh_zypper_service
         end
 
         # @param service_name [String] Alias-mnemonic with which zypper should 
remove this service
@@ -153,7 +154,9 @@
         end
 
         def install_release_package(identifier)
-          call("--no-refresh --non-interactive install --no-recommends 
--auto-agree-with-product-licenses -t product #{identifier}") if identifier
+          return unless identifier
+          _, _, status = execute_raw("rpm -q #{identifier}-release")
+          call("--no-refresh --non-interactive install --no-recommends 
--auto-agree-with-product-licenses -t product #{identifier}") unless (status == 
0)
         end
 
         def remove_release_package(identifier)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/suse/toolkit/system_calls.rb 
new/lib/suse/toolkit/system_calls.rb
--- old/lib/suse/toolkit/system_calls.rb        2018-06-12 12:54:45.000000000 
+0200
+++ new/lib/suse/toolkit/system_calls.rb        2018-09-14 12:15:18.000000000 
+0200
@@ -6,11 +6,17 @@
     module SystemCalls
       include Connect::Logger
 
-      def execute(cmd, quiet = true, valid_exit_codes = [0]) # rubocop:disable 
CyclomaticComplexity
-        log.debug("Executing: '#{cmd}' Quiet: #{quiet}")
+      def execute_raw(cmd)
+        log.debug("Executing raw: '#{cmd}'")
         output, error, status = Open3.capture3({ 'LC_ALL' => 'C' }, cmd) { 
|_stdin, stdout, _stderr, _wait_thr| stdout.read }
         log.debug("Output: '#{output.strip}'") unless output.empty?
         log.debug("Error: '#{error.strip}'") unless error.empty?
+        [output, error, status]
+      end
+
+      def execute(cmd, quiet = true, valid_exit_codes = [0]) # rubocop:disable 
CyclomaticComplexity
+        log.debug("Executing: '#{cmd}' Quiet: #{quiet}")
+        output, error, status = execute_raw(cmd)
 
         # Catching interactive failures of zypper. --non-interactive always 
returns with exit code 0 here
         if !valid_exit_codes.include?(status.exitstatus) || 
error.include?('ABORT request')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/tasks/package.rake new/lib/tasks/package.rake
--- old/lib/tasks/package.rake  2018-06-12 12:54:45.000000000 +0200
+++ new/lib/tasks/package.rake  2018-09-14 12:15:18.000000000 +0200
@@ -3,7 +3,7 @@
 
 def version_from_spec(spec_glob)
   version = `grep '^Version:' #{spec_glob}`
-  version[/(\d\.\d\.\d)/, 0]
+  version[/(\d+\.\d+\.\d+)/, 0]
 end
 
 def upstream_file(name, file_type, obs_project, package_name)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2018-06-12 12:54:45.000000000 +0200
+++ new/metadata        2018-09-14 12:15:18.000000000 +0200
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: suse-connect
 version: !ruby/object:Gem::Version
-  version: 0.3.11
+  version: 0.3.12
 platform: ruby
 authors:
 - SUSE Customer Center Team
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2018-06-12 00:00:00.000000000 Z
+date: 2018-09-14 00:00:00.000000000 Z
 dependencies: []
 description: This package provides a command line tool and rubygem library for 
connecting
   a client system to the SUSE Customer Center. It will connect the system to 
your
@@ -86,7 +86,7 @@
       version: '0'
 requirements: []
 rubyforge_project: 
-rubygems_version: 2.7.6
+rubygems_version: 2.6.13
 signing_key: 
 specification_version: 4
 summary: SUSE Connect utility to register a system with the SUSE Customer 
Center


Reply via email to