Hello community,

here is the log from the commit of package yast2-configuration-management for 
openSUSE:Factory checked in at 2019-03-06 19:02:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-configuration-management (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-configuration-management.new.28833 
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-configuration-management"

Wed Mar  6 19:02:17 2019 rev:11 rq:681237 version:4.1.6

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/yast2-configuration-management/yast2-configuration-management.changes
    2019-02-28 21:47:04.561430997 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-configuration-management.new.28833/yast2-configuration-management.changes
 2019-03-06 19:02:20.145091822 +0100
@@ -1,0 +2,7 @@
+Thu Feb 28 19:22:52 UTC 2019 - Imobach Gonzalez Sosa <[email protected]>
+
+- Fix $visibleIf condition evaluation when the left value is "false"
+  or when the path is absolute (bsc#1127402).
+- 4.1.6
+
+-------------------------------------------------------------------

Old:
----
  yast2-configuration-management-4.1.5.tar.bz2

New:
----
  yast2-configuration-management-4.1.6.tar.bz2

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

Other differences:
------------------
++++++ yast2-configuration-management.spec ++++++
--- /var/tmp/diff_new_pack.9XJ4ar/_old  2019-03-06 19:02:21.285091516 +0100
+++ /var/tmp/diff_new_pack.9XJ4ar/_new  2019-03-06 19:02:21.293091513 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-configuration-management
-Version:        4.1.5
+Version:        4.1.6
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-configuration-management-4.1.5.tar.bz2 -> 
yast2-configuration-management-4.1.6.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-configuration-management-4.1.5/package/yast2-configuration-management.changes
 
new/yast2-configuration-management-4.1.6/package/yast2-configuration-management.changes
--- 
old/yast2-configuration-management-4.1.5/package/yast2-configuration-management.changes
     2019-02-25 15:08:20.000000000 +0100
+++ 
new/yast2-configuration-management-4.1.6/package/yast2-configuration-management.changes
     2019-03-04 10:25:34.000000000 +0100
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Thu Feb 28 19:22:52 UTC 2019 - Imobach Gonzalez Sosa <[email protected]>
+
+- Fix $visibleIf condition evaluation when the left value is "false"
+  or when the path is absolute (bsc#1127402).
+- 4.1.6
+
+-------------------------------------------------------------------
 Mon Feb 25 11:50:56 UTC 2019 - Imobach Gonzalez Sosa <[email protected]>
 
 - fate#322722:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-configuration-management-4.1.5/package/yast2-configuration-management.spec
 
new/yast2-configuration-management-4.1.6/package/yast2-configuration-management.spec
--- 
old/yast2-configuration-management-4.1.5/package/yast2-configuration-management.spec
        2019-02-25 15:08:20.000000000 +0100
+++ 
new/yast2-configuration-management-4.1.6/package/yast2-configuration-management.spec
        2019-03-04 10:25:34.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-configuration-management
-Version:        4.1.5
+Version:        4.1.6
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-configuration-management-4.1.5/src/lib/y2configuration_management/salt/form_condition.rb
 
new/yast2-configuration-management-4.1.6/src/lib/y2configuration_management/salt/form_condition.rb
--- 
old/yast2-configuration-management-4.1.5/src/lib/y2configuration_management/salt/form_condition.rb
  2019-02-25 15:08:20.000000000 +0100
+++ 
new/yast2-configuration-management-4.1.6/src/lib/y2configuration_management/salt/form_condition.rb
  2019-03-04 10:25:34.000000000 +0100
@@ -70,8 +70,15 @@
       # @param data [FormData]
       # @param context [FormElement] for resolving relative expressions
       def evaluate(data, context:)
-        left_locator = @locator.relative? ? context.locator.join(@locator) : 
@locator
-        left = data.get(left_locator).value.to_s
+        left_locator =
+          if @locator.relative?
+            context.locator.join(@locator)
+          else
+            FormElementLocator.root.join(@locator)
+          end
+        left_data = data.get(left_locator)
+        return false if left_data.nil?
+        left = left_data.value.to_s
         right = @value.to_s
         left == right
       end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-configuration-management-4.1.5/src/lib/y2configuration_management/salt/form_data.rb
 
new/yast2-configuration-management-4.1.6/src/lib/y2configuration_management/salt/form_data.rb
--- 
old/yast2-configuration-management-4.1.5/src/lib/y2configuration_management/salt/form_data.rb
       2019-02-25 15:08:20.000000000 +0100
+++ 
new/yast2-configuration-management-4.1.6/src/lib/y2configuration_management/salt/form_data.rb
       2019-03-04 10:25:34.000000000 +0100
@@ -24,6 +24,8 @@
   module Salt
     # This class holds data for a given Salt Formula Form
     class FormData
+      include Yast::Logger
+
       class << self
         # @param form   [Form] Form definition
         # @param pillar [Pillar] Pillar to read the data from
@@ -38,7 +40,7 @@
       #
       # @param initial [Hash] Initial data in hash form
       def initialize(initial)
-        @data = initial || {}
+        @data = initial.nil? ? {} : initial
       end
 
       # Returns the value of a given element
@@ -47,7 +49,11 @@
       # @return [FormData,nil] Form data or nil if no data was found for the 
given locator
       def get(locator)
         value = find_by_locator(@data, locator)
-        value ? FormData.new(value) : nil
+        if value.nil?
+          log.warn "Could not find a value for #{locator}"
+          return nil
+        end
+        FormData.new(value)
       end
 
       # Updates an element's value
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-configuration-management-4.1.5/src/lib/y2configuration_management/salt/form_element_locator.rb
 
new/yast2-configuration-management-4.1.6/src/lib/y2configuration_management/salt/form_element_locator.rb
--- 
old/yast2-configuration-management-4.1.5/src/lib/y2configuration_management/salt/form_element_locator.rb
    2019-02-25 15:08:20.000000000 +0100
+++ 
new/yast2-configuration-management-4.1.6/src/lib/y2configuration_management/salt/form_element_locator.rb
    2019-03-04 10:25:34.000000000 +0100
@@ -81,6 +81,15 @@
           new(nil)
         end
 
+        # Returns the root locator
+        #
+        # Convenience method to return the root locator
+        #
+        # @return [FormElementLocator]
+        def root
+          new([:root])
+        end
+
       private
 
         # @return [String] Locator segments separator
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-configuration-management-4.1.5/test/y2configuration_management/salt/form_condition_test.rb
 
new/yast2-configuration-management-4.1.6/test/y2configuration_management/salt/form_condition_test.rb
--- 
old/yast2-configuration-management-4.1.5/test/y2configuration_management/salt/form_condition_test.rb
        2019-02-25 15:08:20.000000000 +0100
+++ 
new/yast2-configuration-management-4.1.6/test/y2configuration_management/salt/form_condition_test.rb
        2019-03-04 10:25:34.000000000 +0100
@@ -66,7 +66,7 @@
 
       it "compares the string representations" do
         expect(data).to receive(:get)
-          .with(locator_new([:myform, :mywidget]))
+          .with(locator_new([:root, :myform, :mywidget]))
           .and_return(Y2ConfigurationManagement::Salt::FormData.new(42))
         expect(condition.evaluate(data, context: ctxt)).to eq(true)
       end
@@ -81,6 +81,13 @@
           expect(condition.evaluate(data, context: ctxt)).to eq(true)
         end
       end
+
+      context "when the locator points to a missing element" do
+        it "returns false" do
+          expect(data).to receive(:get).and_return(nil)
+          expect(condition.evaluate(data, context: ctxt)).to eq(false)
+        end
+      end
     end
   end
 
@@ -92,7 +99,7 @@
       let(:data) { double("form data") }
 
       it "compares the string representations" do
-        expect(data).to receive(:get).with(locator_new([:myform, :mywidget]))
+        expect(data).to receive(:get).with(locator_new([:root, :myform, 
:mywidget]))
           .and_return(Y2ConfigurationManagement::Salt::FormData.new(42))
         expect(condition.evaluate(data, context: ctxt)).to eq(false)
       end
@@ -107,6 +114,13 @@
           expect(condition.evaluate(data, context: ctxt)).to eq(false)
         end
       end
+
+      context "when the locator points to a missing element" do
+        it "returns true" do
+          expect(data).to receive(:get).and_return(nil)
+          expect(condition.evaluate(data, context: ctxt)).to eq(true)
+        end
+      end
     end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-configuration-management-4.1.5/test/y2configuration_management/salt/form_data_test.rb
 
new/yast2-configuration-management-4.1.6/test/y2configuration_management/salt/form_data_test.rb
--- 
old/yast2-configuration-management-4.1.5/test/y2configuration_management/salt/form_data_test.rb
     2019-02-25 15:08:20.000000000 +0100
+++ 
new/yast2-configuration-management-4.1.6/test/y2configuration_management/salt/form_data_test.rb
     2019-03-04 10:25:34.000000000 +0100
@@ -41,6 +41,17 @@
       end
     end
 
+    context "when the value is 'false'" do
+      before do
+        form_data.update(locator_from_string("root#person#newsletter"), 
"wanted" => false)
+      end
+
+      it "returns the value" do
+        wanted_newsletter = 
form_data.get(locator_from_string("root#person#newsletter#wanted"))
+        expect(wanted_newsletter.value).to eq(false)
+      end
+    end
+
     context "when the locator refers to an index based collection locator is 
given" do
       it "returns a FormData instance containing the collection values" do
         computers = form_data.get(locator_from_string("root#person#computers"))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-configuration-management-4.1.5/test/y2configuration_management/salt/form_element_locator_test.rb
 
new/yast2-configuration-management-4.1.6/test/y2configuration_management/salt/form_element_locator_test.rb
--- 
old/yast2-configuration-management-4.1.5/test/y2configuration_management/salt/form_element_locator_test.rb
  2019-02-25 15:08:20.000000000 +0100
+++ 
new/yast2-configuration-management-4.1.6/test/y2configuration_management/salt/form_element_locator_test.rb
  2019-03-04 10:25:34.000000000 +0100
@@ -61,6 +61,14 @@
     end
   end
 
+  describe ".root" do
+    it "returns the root locator" do
+      root_locator = described_class.root
+      expect(root_locator.parts).to eq([:root])
+      expect(root_locator.upto).to be_zero
+    end
+  end
+
   describe "#to_s" do
     it "returns the string representation of the element locator" do
       expect(locator.to_s).to eq("root#hosts[1]#interfaces[3]")


Reply via email to