Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yast2-users for openSUSE:Factory 
checked in at 2023-04-04 21:17:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-users (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-users.new.19717 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-users"

Tue Apr  4 21:17:14 2023 rev:255 rq:1076930 version:4.6.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-users/yast2-users.changes  2023-03-04 
22:44:05.992007127 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-users.new.19717/yast2-users.changes       
2023-04-04 21:17:16.067984403 +0200
@@ -1,0 +2,12 @@
+Thu Mar 23 14:04:54 UTC 2023 - Ancor Gonzalez Sosa <an...@suse.com>
+
+- Stop mangling the value of "Create as Btrfs Subvolume" for new
+  users when clicking on "Edit -> Details" (bsc#1209377).
+- 4.6.1
+
+-------------------------------------------------------------------
+Thu Mar 23 14:00:00 UTC 2023 - José Iván López González <jlo...@suse.com>
+
+- AutoYaST: Fix creation of home for system users (bsc#1202974).
+
+-------------------------------------------------------------------

Old:
----
  yast2-users-4.6.0.tar.bz2

New:
----
  yast2-users-4.6.1.tar.bz2

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

Other differences:
------------------
++++++ yast2-users.spec ++++++
--- /var/tmp/diff_new_pack.a6TytD/_old  2023-04-04 21:17:17.059990727 +0200
+++ /var/tmp/diff_new_pack.a6TytD/_new  2023-04-04 21:17:17.063990752 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-users
-Version:        4.6.0
+Version:        4.6.1
 Release:        0
 Summary:        YaST2 - User and Group Configuration
 License:        GPL-2.0-only

++++++ yast2-users-4.6.0.tar.bz2 -> yast2-users-4.6.1.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-users-4.6.0/package/yast2-users.changes 
new/yast2-users-4.6.1/package/yast2-users.changes
--- old/yast2-users-4.6.0/package/yast2-users.changes   2023-03-03 
16:03:52.000000000 +0100
+++ new/yast2-users-4.6.1/package/yast2-users.changes   2023-04-03 
13:48:38.000000000 +0200
@@ -1,4 +1,16 @@
 -------------------------------------------------------------------
+Thu Mar 23 14:04:54 UTC 2023 - Ancor Gonzalez Sosa <an...@suse.com>
+
+- Stop mangling the value of "Create as Btrfs Subvolume" for new
+  users when clicking on "Edit -> Details" (bsc#1209377).
+- 4.6.1
+
+-------------------------------------------------------------------
+Thu Mar 23 14:00:00 UTC 2023 - José Iván López González <jlo...@suse.com>
+
+- AutoYaST: Fix creation of home for system users (bsc#1202974).
+
+-------------------------------------------------------------------
 Fri Mar 03 14:44:07 UTC 2023 - Ladislav Slezák <lsle...@suse.cz>
 
 - Bump version to 4.6.0 (bsc#1208913)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-users-4.6.0/package/yast2-users.spec 
new/yast2-users-4.6.1/package/yast2-users.spec
--- old/yast2-users-4.6.0/package/yast2-users.spec      2023-03-03 
16:03:52.000000000 +0100
+++ new/yast2-users-4.6.1/package/yast2-users.spec      2023-04-03 
13:48:38.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-users
-Version:        4.6.0
+Version:        4.6.1
 Release:        0
 Summary:        YaST2 - User and Group Configuration
 License:        GPL-2.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-users-4.6.0/src/lib/y2users/home.rb 
new/yast2-users-4.6.1/src/lib/y2users/home.rb
--- old/yast2-users-4.6.0/src/lib/y2users/home.rb       2023-03-03 
16:03:52.000000000 +0100
+++ new/yast2-users-4.6.1/src/lib/y2users/home.rb       2023-04-03 
13:48:38.000000000 +0200
@@ -1,4 +1,4 @@
-# Copyright (c) [2021] SUSE LLC
+# Copyright (c) [2021-2022] SUSE LLC
 #
 # All Rights Reserved.
 #
@@ -56,5 +56,12 @@
     def btrfs_subvol?
       !!@btrfs_subvol
     end
+
+    # Whether home has a defined path
+    #
+    # @return [Boolean]
+    def path?
+      !path.to_s.empty?
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-users-4.6.0/src/lib/y2users/linux/create_user_action.rb 
new/yast2-users-4.6.1/src/lib/y2users/linux/create_user_action.rb
--- old/yast2-users-4.6.0/src/lib/y2users/linux/create_user_action.rb   
2023-03-03 16:03:52.000000000 +0100
+++ new/yast2-users-4.6.1/src/lib/y2users/linux/create_user_action.rb   
2023-04-03 13:48:38.000000000 +0200
@@ -1,4 +1,4 @@
-# Copyright (c) [2021] SUSE LLC
+# Copyright (c) [2021-2022] SUSE LLC
 #
 # All Rights Reserved.
 #
@@ -122,7 +122,9 @@
       # @param skip_home [Boolean]
       # @return [Array<String>]
       def home_options(skip_home: false)
-        return [] if user.system?
+        # If a home is configured for a system user (e.g., with AutoYaST), 
then its home should be
+        # created (bsc#1202974).
+        return [] if user.system? && !user.home&.path?
 
         return ["--no-create-home"] if skip_home
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-users-4.6.0/src/modules/Users.pm 
new/yast2-users-4.6.1/src/modules/Users.pm
--- old/yast2-users-4.6.0/src/modules/Users.pm  2023-03-03 16:03:52.000000000 
+0100
+++ new/yast2-users-4.6.1/src/modules/Users.pm  2023-04-03 13:48:38.000000000 
+0200
@@ -2328,7 +2328,7 @@
            }
        }
        if ($key eq "create_home" || $key eq "delete_home" ||
-           $key eq "chown_home" ||
+           $key eq "chown_home" || $key eq "btrfs_subvolume" ||
            $key eq "encrypted" ||$key eq "no_skeleton" ||
            $key eq "disabled" || $key eq "enabled") {
            if (ref $data{$key} eq "YaST::YCP::Boolean") {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-users-4.6.0/test/lib/y2users/home_test.rb 
new/yast2-users-4.6.1/test/lib/y2users/home_test.rb
--- old/yast2-users-4.6.0/test/lib/y2users/home_test.rb 2023-03-03 
16:03:52.000000000 +0100
+++ new/yast2-users-4.6.1/test/lib/y2users/home_test.rb 2023-04-03 
13:48:38.000000000 +0200
@@ -1,6 +1,6 @@
 #!/usr/bin/env rspec
 
-# Copyright (c) [2021] SUSE LLC
+# Copyright (c) [2021-2022] SUSE LLC
 #
 # All Rights Reserved.
 #
@@ -100,4 +100,34 @@
       end
     end
   end
+
+  describe "path?" do
+    before do
+      subject.path = path
+    end
+
+    context "if the path is nil" do
+      let(:path) { nil }
+
+      it "returns false" do
+        expect(subject.path?).to eq(false)
+      end
+    end
+
+    context "if the path is empty" do
+      let(:path) { "" }
+
+      it "returns false" do
+        expect(subject.path?).to eq(false)
+      end
+    end
+
+    context "if the path is not empty" do
+      let(:path) { "/home/test" }
+
+      it "returns true" do
+        expect(subject.path?).to eq(true)
+      end
+    end
+  end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-users-4.6.0/test/lib/y2users/linux/create_user_action_test.rb 
new/yast2-users-4.6.1/test/lib/y2users/linux/create_user_action_test.rb
--- old/yast2-users-4.6.0/test/lib/y2users/linux/create_user_action_test.rb     
2023-03-03 16:03:52.000000000 +0100
+++ new/yast2-users-4.6.1/test/lib/y2users/linux/create_user_action_test.rb     
2023-04-03 13:48:38.000000000 +0200
@@ -1,6 +1,6 @@
 #!/usr/bin/env rspec
 
-# Copyright (c) [2021] SUSE LLC
+# Copyright (c) [2021-2022] SUSE LLC
 #
 # All Rights Reserved.
 #
@@ -127,29 +127,16 @@
       action.perform
     end
 
-    context "for a local user" do
-      it "passes --create-home parameter" do
-        expect(Yast::Execute).to receive(:on_target!) do |_cmd, *args|
-          expect(args).to include("--create-home")
-          expect(args).to_not include("--home-dir")
-          expect(args).to_not include("--btrfs-subvolume-home")
-          expect(args).to_not include("--key")
-        end
-
-        action.perform
-      end
-
-      it "passes --home-dir parameter if the home path is known" do
-        user.home.path = "/home/test"
-
-        expect(Yast::Execute).to receive(:on_target!) do |_cmd, *args|
-          expect(args).to include("--home-dir")
-          expect(args).to include("/home/test")
-        end
+    it "returns result without success and with issues if cmd failed" do
+      allow(Yast::Execute).to receive(:on_target!)
+        .and_raise(Cheetah::ExecutionFailed.new(nil, double(exitstatus: 1), 
nil, nil))
 
-        action.perform
-      end
+      result = action.perform
+      expect(result.success?).to eq false
+      expect(result.issues).to_not be_empty
+    end
 
+    shared_examples "home options" do
       it "passes --btrfs-subvolume-home parameter if btrfs home configured" do
         user.home.btrfs_subvol = true
 
@@ -172,8 +159,8 @@
       end
     end
 
-    context "home creation failed" do
-      it "retry to create user if home.path is not specified" do
+    shared_examples "home creation failed" do
+      it "retries to create user if home creation failed" do
         expect(Yast::Execute).to receive(:on_target!).twice do |_cmd, *args|
           if !args.include?("--no-create-home")
             raise Cheetah::ExecutionFailed.new([], double(exitstatus: 12), "", 
"")
@@ -184,13 +171,89 @@
       end
     end
 
-    it "returns result without success and with issues if cmd failed" do
-      allow(Yast::Execute).to receive(:on_target!)
-        .and_raise(Cheetah::ExecutionFailed.new(nil, double(exitstatus: 1), 
nil, nil))
+    context "for a system user" do
+      before do
+        user.system = true
+      end
 
-      result = action.perform
-      expect(result.success?).to eq false
-      expect(result.issues).to_not be_empty
+      context "if the home path is known" do
+        before do
+          user.home.path = "/home/test"
+        end
+
+        it "passes --create-home parameter" do
+          expect(Yast::Execute).to receive(:on_target!) do |_cmd, *args|
+            expect(args).to include("--create-home")
+          end
+
+          action.perform
+        end
+
+        it "passes --home-dir parameter" do
+          user.home.path = "/home/test"
+
+          expect(Yast::Execute).to receive(:on_target!) do |_cmd, *args|
+            expect(args).to include("--home-dir")
+            expect(args).to include("/home/test")
+          end
+
+          action.perform
+        end
+
+        include_examples "home options"
+
+        include_examples "home creation failed"
+      end
+
+      context "if the home path is unknown" do
+        before do
+          user.home.path = ""
+        end
+
+        it "does not pass --create-home parameter" do
+          expect(Yast::Execute).to receive(:on_target!) do |_cmd, *args|
+            expect(args).to_not include("--create-home")
+          end
+
+          action.perform
+        end
+
+        it "does not pass --home-dir parameter" do
+          expect(Yast::Execute).to receive(:on_target!) do |_cmd, *args|
+            expect(args).to_not include("--home-dir")
+          end
+
+          action.perform
+        end
+      end
+    end
+
+    context "for a local user" do
+      it "passes --create-home parameter" do
+        expect(Yast::Execute).to receive(:on_target!) do |_cmd, *args|
+          expect(args).to include("--create-home")
+          expect(args).to_not include("--home-dir")
+          expect(args).to_not include("--btrfs-subvolume-home")
+          expect(args).to_not include("--key")
+        end
+
+        action.perform
+      end
+
+      it "passes --home-dir parameter if the home path is known" do
+        user.home.path = "/home/test"
+
+        expect(Yast::Execute).to receive(:on_target!) do |_cmd, *args|
+          expect(args).to include("--home-dir")
+          expect(args).to include("/home/test")
+        end
+
+        action.perform
+      end
+
+      include_examples "home options"
+
+      include_examples "home creation failed"
     end
   end
 end

Reply via email to