commit yast2-firstboot for openSUSE:Factory
Hello community, here is the log from the commit of package yast2-firstboot for openSUSE:Factory checked in at 2019-02-04 21:11:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-firstboot (Old) and /work/SRC/openSUSE:Factory/.yast2-firstboot.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-firstboot" Mon Feb 4 21:11:13 2019 rev:76 rq:669044 version:4.1.4 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-firstboot/yast2-firstboot.changes 2019-01-15 09:16:45.790213851 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-firstboot.new.28833/yast2-firstboot.changes 2019-02-04 21:11:14.751872633 +0100 @@ -1,0 +2,7 @@ +Fri Jan 25 14:59:38 UTC 2019 - igonzalezsosa@suse.com + +- Add integration with the yast2-configuration-management module + (fate#322722). +- 4.1.4 + +------------------------------------------------------------------- Old: ---- yast2-firstboot-4.1.3.tar.bz2 New: ---- yast2-firstboot-4.1.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-firstboot.spec ++++++ --- /var/tmp/diff_new_pack.KUNrJi/_old 2019-02-04 21:11:15.227872462 +0100 +++ /var/tmp/diff_new_pack.KUNrJi/_new 2019-02-04 21:11:15.231872460 +0100 @@ -17,7 +17,7 @@ Name: yast2-firstboot -Version: 4.1.3 +Version: 4.1.4 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -39,6 +39,7 @@ BuildArch: noarch +Requires: yast2-configuration-management >= 4.1.1 Requires: yast2-ruby-bindings >= 1.0.0 Summary: YaST2 - Initial System Configuration ++++++ yast2-firstboot-4.1.3.tar.bz2 -> yast2-firstboot-4.1.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-firstboot-4.1.3/.rubocop.yml new/yast2-firstboot-4.1.4/.rubocop.yml --- old/yast2-firstboot-4.1.3/.rubocop.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-firstboot-4.1.4/.rubocop.yml 2019-01-28 12:15:42.000000000 +0100 @@ -0,0 +1,18 @@ +# use the shared YaST defaults +inherit_from: + /usr/share/YaST2/data/devtools/data/rubocop_yast_style.yml + +# Don't enforce any particular name for block params +SingleLineBlockParams: + Enabled: false + +# Enforce if/unless at the end only for really short lines +Style/IfUnlessModifier: + MaxLineLength: 60 + +AllCops: + Exclude: + - 'src/modules/**/*' + - 'src/include/**/*' + - 'testsuite/**/*' + - 'src/clients/*' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-firstboot-4.1.3/Dockerfile new/yast2-firstboot-4.1.4/Dockerfile --- old/yast2-firstboot-4.1.3/Dockerfile 2019-01-11 17:21:48.000000000 +0100 +++ new/yast2-firstboot-4.1.4/Dockerfile 2019-01-28 12:15:42.000000000 +0100 @@ -1,5 +1,5 @@ FROM yastdevel/ruby RUN zypper --gpg-auto-import-keys --non-interactive in --no-recommends \ - docbook-xsl-stylesheets + docbook-xsl-stylesheets yast2-configuration-management COPY . /usr/src/app diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-firstboot-4.1.3/Rakefile new/yast2-firstboot-4.1.4/Rakefile --- old/yast2-firstboot-4.1.3/Rakefile 2019-01-11 17:21:48.000000000 +0100 +++ new/yast2-firstboot-4.1.4/Rakefile 2019-01-28 12:15:42.000000000 +0100 @@ -1,6 +1,6 @@ require "yast/rake" Yast::Tasks.configuration do |conf| - #lets ignore license check for now + # lets ignore license check for now conf.skip_license_check << /.*/ end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-firstboot-4.1.3/package/yast2-firstboot.changes new/yast2-firstboot-4.1.4/package/yast2-firstboot.changes --- old/yast2-firstboot-4.1.3/package/yast2-firstboot.changes 2019-01-11 17:21:48.000000000 +0100 +++ new/yast2-firstboot-4.1.4/package/yast2-firstboot.changes 2019-01-28 12:15:42.000000000 +0100 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Fri Jan 25 14:59:38 UTC 2019 - igonzalezsosa@suse.com + +- Add integration with the yast2-configuration-management module + (fate#322722). +- 4.1.4 + +------------------------------------------------------------------- Fri Jan 11 16:13:58 UTC 2019 - lslezak@suse.cz - Fixed textdomain name (bsc#1121643) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-firstboot-4.1.3/package/yast2-firstboot.spec new/yast2-firstboot-4.1.4/package/yast2-firstboot.spec --- old/yast2-firstboot-4.1.3/package/yast2-firstboot.spec 2019-01-11 17:21:48.000000000 +0100 +++ new/yast2-firstboot-4.1.4/package/yast2-firstboot.spec 2019-01-28 12:15:42.000000000 +0100 @@ -16,7 +16,7 @@ # Name: yast2-firstboot -Version: 4.1.3 +Version: 4.1.4 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -39,6 +39,7 @@ BuildArchitectures: noarch Requires: yast2-ruby-bindings >= 1.0.0 +Requires: yast2-configuration-management >= 4.1.1 Summary: YaST2 - Initial System Configuration PreReq: %fillup_prereq diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-firstboot-4.1.3/src/Makefile.am new/yast2-firstboot-4.1.4/src/Makefile.am --- old/yast2-firstboot-4.1.3/src/Makefile.am 2019-01-11 17:21:48.000000000 +0100 +++ new/yast2-firstboot-4.1.4/src/Makefile.am 2019-01-28 12:15:42.000000000 +0100 @@ -24,7 +24,8 @@ clients/firstboot_auto.rb \ clients/firstboot_hostname.rb \ clients/firstboot_root.rb \ - clients/firstboot_user.rb + clients/firstboot_user.rb \ + clients/firstboot_configuration_management.rb yncludedir = @yncludedir@/firstboot ynclude_DATA = \ @@ -42,6 +43,7 @@ ylibclientdir = "${yast2dir}/lib/y2firstboot/clients" ylibclient_DATA = \ + lib/y2firstboot/clients/configuration_management.rb \ lib/y2firstboot/clients/root.rb \ lib/y2firstboot/clients/user.rb diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-firstboot-4.1.3/src/clients/firstboot_configuration_management.rb new/yast2-firstboot-4.1.4/src/clients/firstboot_configuration_management.rb --- old/yast2-firstboot-4.1.3/src/clients/firstboot_configuration_management.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-firstboot-4.1.4/src/clients/firstboot_configuration_management.rb 2019-01-28 12:15:42.000000000 +0100 @@ -0,0 +1,24 @@ +# encoding: utf-8 + +# Copyright (c) [2018] SUSE LLC +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, contact SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + +require "y2firstboot/clients/configuration_management" + +Y2Firstboot::Clients::ConfigurationManagement.new.run diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-firstboot-4.1.3/src/lib/y2firstboot/clients/configuration_management.rb new/yast2-firstboot-4.1.4/src/lib/y2firstboot/clients/configuration_management.rb --- old/yast2-firstboot-4.1.3/src/lib/y2firstboot/clients/configuration_management.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-firstboot-4.1.4/src/lib/y2firstboot/clients/configuration_management.rb 2019-01-28 12:15:42.000000000 +0100 @@ -0,0 +1,62 @@ +# encoding: utf-8 + +# Copyright (c) [2018] SUSE LLC +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, contact SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + +require "yast" +require "configuration_management/clients/provision" +require "configuration_management/configurators/base" + +Yast.import "ProductFeatures" +Yast.import "PackageSystem" + +module Y2Firstboot + module Clients + # This client is meant to be used in firstboot + class ConfigurationManagement + # Runs the client + def run + configurator = Yast::ConfigurationManagement::Configurators::Base.for(config) + return :abort unless configurator.prepare + if !Yast::PackageSystem.CheckAndInstallPackages(configurator.packages.fetch("install", [])) + return :abort + end + Yast::ConfigurationManagement::Clients::Provision.new.run + :auto + end + + private + + # @return [Hash] Fixed settings (these settings cannot be overriden as this is the only + # supported scenario) + FIXED_SETTINGS = { "type" => "salt", "mode" => "masterless" }.freeze + + # Returns the configuration management configuration + # + # It relies in the configuration found in the control file. + # + # @return [Yast::ConfigurationManagement::Configurations::Base] + def config + settings = Yast::ProductFeatures.GetSection("configuration_management") + .merge(FIXED_SETTINGS) + Yast::ConfigurationManagement::Configurations::Base.import(settings) + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-firstboot-4.1.3/src/lib/y2firstboot/clients/root.rb new/yast2-firstboot-4.1.4/src/lib/y2firstboot/clients/root.rb --- old/yast2-firstboot-4.1.3/src/lib/y2firstboot/clients/root.rb 2019-01-11 17:21:48.000000000 +0100 +++ new/yast2-firstboot-4.1.4/src/lib/y2firstboot/clients/root.rb 2019-01-28 12:15:42.000000000 +0100 @@ -26,6 +26,7 @@ module Y2Firstboot module Clients + # Client to set the root password class Root < Yast::Client def run dialog_result = Yast::InstRootFirstDialog.new.run diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-firstboot-4.1.3/src/lib/y2firstboot/clients/user.rb new/yast2-firstboot-4.1.4/src/lib/y2firstboot/clients/user.rb --- old/yast2-firstboot-4.1.3/src/lib/y2firstboot/clients/user.rb 2019-01-11 17:21:48.000000000 +0100 +++ new/yast2-firstboot-4.1.4/src/lib/y2firstboot/clients/user.rb 2019-01-28 12:15:42.000000000 +0100 @@ -28,8 +28,8 @@ module Y2Firstboot module Clients + # Client to set up the first user class User < Yast::Client - def initialize Yast.include self, "users/routines.rb" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-firstboot-4.1.3/test/test_helper.rb new/yast2-firstboot-4.1.4/test/test_helper.rb --- old/yast2-firstboot-4.1.3/test/test_helper.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-firstboot-4.1.4/test/test_helper.rb 2019-01-28 12:15:42.000000000 +0100 @@ -0,0 +1,49 @@ +srcdir = File.expand_path("../../src", __FILE__) +y2dirs = ENV.fetch("Y2DIR", "").split(":") +ENV["Y2DIR"] = y2dirs.unshift(srcdir).join(":") + +require "yast" +require "pathname" + +TESTS_PATH = Pathname.new(File.dirname(__FILE__)) +FIXTURES_PATH = TESTS_PATH.join("fixtures") + +if ENV["COVERAGE"] + require "simplecov" + SimpleCov.start do + add_filter "/test/" + end + + # for coverage we need to load all ruby files + src_location = File.expand_path("../../src", __FILE__) + Dir["#{src_location}/{module,lib}/**/*.rb"].each { |f| require_relative f } + + # use coveralls for on-line code coverage reporting at Travis CI + if ENV["TRAVIS"] + require "coveralls" + SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ + SimpleCov::Formatter::HTMLFormatter, + Coveralls::SimpleCov::Formatter + ] + end +end + +RSpec.configure do |config| + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-firstboot-4.1.3/test/y2firstboot/clients/configuration_management_test.rb new/yast2-firstboot-4.1.4/test/y2firstboot/clients/configuration_management_test.rb --- old/yast2-firstboot-4.1.3/test/y2firstboot/clients/configuration_management_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-firstboot-4.1.4/test/y2firstboot/clients/configuration_management_test.rb 2019-01-28 12:15:42.000000000 +0100 @@ -0,0 +1,97 @@ +#!/usr/bin/env rspec +# encoding: utf-8 + +# Copyright (c) [2018] SUSE LLC +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, contact SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + +require_relative "../../test_helper" +require "y2firstboot/clients/configuration_management" +require "configuration_management/configurators/salt" + +describe Y2Firstboot::Clients::ConfigurationManagement do + subject(:client) { described_class.new } + + describe "#run" do + let(:provisioner) do + instance_double(Yast::ConfigurationManagement::Clients::Provision, run: nil) + end + let(:configurator) do + instance_double( + Yast::ConfigurationManagement::Configurators::Salt, prepare: true, packages: packages + ) + end + let(:packages) { { "install" => ["salt"] } } + let(:settings) { { "states_roots" => ["/srv/salt"] } } + + before do + allow(Yast::ProductFeatures).to receive(:GetSection) + .with("configuration_management") + .and_return(settings) + allow(Yast::ConfigurationManagement::Configurators::Base).to receive(:for) + .and_return(configurator) + allow(Yast::ConfigurationManagement::Clients::Provision).to receive(:new) + .and_return(provisioner) + allow(Yast::PackageSystem).to receive(:CheckAndInstallPackages).and_return(true) + end + + it "uses the configuration from the control file" do + expect(Yast::ConfigurationManagement::Configurators::Base).to receive(:for) do |config| + expect(config.states_roots).to include(Pathname.new("/srv/salt")) + configurator + end + client.run + end + + it "runs the configuration management system" do + expect(provisioner).to receive(:run) + client.run + end + + it "ensures that needed packages are installed" do + expect(Yast::PackageSystem).to receive(:CheckAndInstallPackages).with(["salt"]) + .and_return(true) + client.run + end + + it "returns :auto" do + expect(client.run).to eq(:auto) + end + + context "when type or mode are specified in the configuration" do + let(:settings) { { "type" => "puppet", "mode" => "client" } } + + it "forces type and mode" do + expect(Yast::ConfigurationManagement::Configurators::Base).to receive(:for) + .with(an_object_having_attributes(type: "salt", mode: :masterless)) + .and_return(configurator) + client.run + end + end + + context "when no settings are specified" do + let(:settings) { {} } + + it "uses the default configuration" do + expect(Yast::ConfigurationManagement::Configurators::Base).to receive(:for) + .with(an_object_having_attributes(type: "salt")).and_return(configurator) + client.run + end + end + end +end
participants (1)
-
root