Hello community, here is the log from the commit of package yast2 for openSUSE:Factory checked in at 2014-03-11 09:24:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2 (Old) and /work/SRC/openSUSE:Factory/.yast2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2/yast2.changes 2014-03-06 19:29:43.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.yast2.new/yast2.changes 2014-03-11 09:24:11.000000000 +0100 @@ -1,0 +2,7 @@ +Thu Mar 6 15:21:44 UTC 2014 - vmora...@suse.com + +- Allow raising exceptions for not found systemd units; + updates the expectations for bnc#853300 +- 3.1.23 + +------------------------------------------------------------------- Old: ---- yast2-3.1.22.tar.bz2 New: ---- yast2-3.1.23.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2.spec ++++++ --- /var/tmp/diff_new_pack.6Q74FQ/_old 2014-03-11 09:24:12.000000000 +0100 +++ /var/tmp/diff_new_pack.6Q74FQ/_new 2014-03-11 09:24:12.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2 -Version: 3.1.22 +Version: 3.1.23 Release: 0 Url: https://github.com/yast/yast-yast2 ++++++ yast2-3.1.22.tar.bz2 -> yast2-3.1.23.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.22/library/systemd/src/modules/systemd_service.rb new/yast2-3.1.23/library/systemd/src/modules/systemd_service.rb --- old/yast2-3.1.22/library/systemd/src/modules/systemd_service.rb 2014-03-06 09:38:04.000000000 +0100 +++ new/yast2-3.1.23/library/systemd/src/modules/systemd_service.rb 2014-03-07 10:37:30.000000000 +0100 @@ -11,11 +11,20 @@ # Yast.import 'SystemdService' # # ## Get a service unit by its name + # ## If the service unit can't be found, you'll get nil + # + # service = Yast::SystemdService.find('sshd') # service unit object # - # service = Yast::SystemdService.find('sshd') # # or using the full unit id 'sshd.service' + # # service = Yast::SystemdService.find('sshd.service') # + # ## If you can't handle any nil at the place of calling, + # ## use the finder with exclamation mark; + # ## SystemdServiceNotFound exception will be raised + # + # service = Yast::SystemdService.find!('IcanHasMoar') # SystemdServiceNotFound: Service unit 'IcanHasMoar' not found + # # ## Get basic unit properties # # service.unit_name # 'sshd' @@ -56,6 +65,12 @@ # ## + class SystemdServiceNotFound < StandardError + def initialize service_name + super "Service unit '#{service_name}' not found" + end + end + class SystemdServiceClass < Module UNIT_SUFFIX = ".service" @@ -66,6 +81,10 @@ service end + def find! service_name, properties={} + find(service_name, properties) || raise(SystemdServiceNotFound, service_name) + end + def all properties={} services = Systemctl.service_units.map do |service_unit| Service.new(service_unit, properties) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.22/library/systemd/src/modules/systemd_socket.rb new/yast2-3.1.23/library/systemd/src/modules/systemd_socket.rb --- old/yast2-3.1.22/library/systemd/src/modules/systemd_socket.rb 2014-03-06 09:38:04.000000000 +0100 +++ new/yast2-3.1.23/library/systemd/src/modules/systemd_socket.rb 2014-03-07 10:37:30.000000000 +0100 @@ -11,8 +11,15 @@ # Yast.import 'SystemdSocket' # # ## Get a socket unit by its name + # ## If the socket unit can't be found, you'll get a nil object # - # socket = Yast::SystemdSocket.find('iscsid') + # socket = Yast::SystemdSocket.find('iscsid') # socket unit object + # + # ## If you can't handle any nil at the place of calling, + # ## use the finder with exclamation mark; + # ## SystemdSocketNotFound exception will be raised + # + # socket = Yast::SystemdSocket.find!('IcanHasCheez') # SystemdSocketNotFound: Socket unit 'IcanHasCheez' not found # # ## Get basic unit properties # @@ -52,6 +59,12 @@ # ## + class SystemdSocketNotFound < StandardError + def initialize socket_name + super "Socket unit '#{socket_name}' not found" + end + end + class SystemdSocketClass < Module UNIT_SUFFIX = ".socket" @@ -62,6 +75,10 @@ socket end + def find! socket_name, properties={} + find(socket_name, properties) || raise(SystemdSocketNotFound, socket_name) + end + def all properties={} sockets = Systemctl.socket_units.map do |socket_unit| Socket.new(socket_unit, properties) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.22/library/systemd/test/data/unknown_socket_properties new/yast2-3.1.23/library/systemd/test/data/unknown_socket_properties --- old/yast2-3.1.22/library/systemd/test/data/unknown_socket_properties 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-3.1.23/library/systemd/test/data/unknown_socket_properties 2014-03-07 10:37:30.000000000 +0100 @@ -0,0 +1,105 @@ +Id=unknown.socket +Names=unknown.socket +Description=unknown.socket +LoadState=not-found +ActiveState=inactive +SubState=dead +InactiveExitTimestampMonotonic=0 +ActiveEnterTimestampMonotonic=0 +ActiveExitTimestampMonotonic=0 +InactiveEnterTimestampMonotonic=0 +CanStart=yes +CanStop=yes +CanReload=no +CanIsolate=no +StopWhenUnneeded=no +RefuseManualStart=no +RefuseManualStop=no +AllowIsolate=no +DefaultDependencies=yes +OnFailureIsolate=no +IgnoreOnIsolate=no +IgnoreOnSnapshot=no +NeedDaemonReload=no +JobTimeoutUSec=0 +ConditionTimestampMonotonic=0 +ConditionResult=no +LoadError=org.freedesktop.DBus.Error.FileNotFound "No such file or directory" +Transient=no +BindIPv6Only=default +Backlog=128 +TimeoutUSec=1min 30s +ControlPID=0 +DirectoryMode=0755 +SocketMode=0666 +Accept=no +KeepAlive=no +Priority=-1 +ReceiveBuffer=0 +SendBuffer=0 +IPTOS=-1 +IPTTL=-1 +PipeSize=0 +FreeBind=no +Transparent=no +Broadcast=no +PassCredentials=no +PassSecurity=no +Mark=-1 +MaxConnections=64 +NConnections=0 +NAccepted=0 +Result=success +ReusePort=no +UMask=0022 +LimitCPU=18446744073709551615 +LimitFSIZE=18446744073709551615 +LimitDATA=18446744073709551615 +LimitSTACK=18446744073709551615 +LimitCORE=18446744073709551615 +LimitRSS=18446744073709551615 +LimitNOFILE=65536 +LimitAS=18446744073709551615 +LimitNPROC=7770 +LimitMEMLOCK=65536 +LimitLOCKS=18446744073709551615 +LimitSIGPENDING=7770 +LimitMSGQUEUE=819200 +LimitNICE=0 +LimitRTPRIO=0 +LimitRTTIME=18446744073709551615 +OOMScoreAdjust=0 +Nice=0 +IOScheduling=0 +CPUSchedulingPolicy=0 +CPUSchedulingPriority=0 +TimerSlackNSec=50000 +CPUSchedulingResetOnFork=no +NonBlocking=no +StandardInput=null +StandardOutput=journal +StandardError=inherit +TTYReset=no +TTYVHangup=no +TTYVTDisallocate=no +SyslogPriority=30 +SyslogLevelPrefix=yes +SecureBits=0 +CapabilityBoundingSet=18446744073709551615 +MountFlags=0 +PrivateTmp=no +PrivateNetwork=no +SameProcessGroup=no +IgnoreSIGPIPE=yes +NoNewPrivileges=no +KillMode=control-group +KillSignal=15 +SendSIGKILL=yes +SendSIGHUP=no +CPUAccounting=no +CPUShares=1024 +BlockIOAccounting=no +BlockIOWeight=1000 +MemoryAccounting=no +MemoryLimit=18446744073709551615 +DevicePolicy=auto diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.22/library/systemd/test/systemd_service_test.rb new/yast2-3.1.23/library/systemd/test/systemd_service_test.rb --- old/yast2-3.1.22/library/systemd/test/systemd_service_test.rb 2014-03-06 09:38:04.000000000 +0100 +++ new/yast2-3.1.23/library/systemd/test/systemd_service_test.rb 2014-03-07 10:37:30.000000000 +0100 @@ -29,6 +29,20 @@ end end + describe ".find!" do + it "returns the service unit object specified in parameter" do + service = SystemdService.find('sshd') + expect(service).to be_a(SystemdUnit) + expect(service.unit_type).to eq("service") + expect(service.unit_name).to eq("sshd") + end + + it "raises SystemdServiceNotFound error if unit does not exist" do + stub_services(:service=>'unknown') + expect { SystemdService.find!('unknown') }.to raise_error(SystemdServiceNotFound) + end + end + describe ".all" do it "returns all supported services found" do services = SystemdService.all diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.22/library/systemd/test/systemd_socket_test.rb new/yast2-3.1.23/library/systemd/test/systemd_socket_test.rb --- old/yast2-3.1.22/library/systemd/test/systemd_socket_test.rb 2014-03-06 09:38:04.000000000 +0100 +++ new/yast2-3.1.23/library/systemd/test/systemd_socket_test.rb 2014-03-07 10:37:30.000000000 +0100 @@ -21,6 +21,20 @@ end end + describe ".find!" do + it "returns the unit object specified in parameter" do + socket = SystemdSocket.find "iscsid" + expect(socket).to be_a(SystemdUnit) + expect(socket.unit_type).to eq("socket") + expect(socket.unit_name).to eq("iscsid") + end + + it "raises SystemdSocketNotFound error if unit does not exist" do + stub_sockets(:socket=>'unknown') + expect { SystemdSocket.find!('unknown') }.to raise_error(SystemdSocketNotFound) + end + end + describe ".all" do it "returns all supported sockets found" do sockets = SystemdSocket.all diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.22/library/systemd/test/test_helper.rb new/yast2-3.1.23/library/systemd/test/test_helper.rb --- old/yast2-3.1.22/library/systemd/test/test_helper.rb 2014-03-06 09:38:04.000000000 +0100 +++ new/yast2-3.1.23/library/systemd/test/test_helper.rb 2014-03-07 10:37:30.000000000 +0100 @@ -96,25 +96,22 @@ include SystemctlStubs include SystemdUnitStubs - def socket_properties - @properties ||= OpenStruct.new( - :stdout => File.read(File.join(__dir__, 'data', 'iscsid_socket_properties')), - :stderr => '', + def load_socket_properties socket_name + OpenStruct.new( + :stdout => File.read(File.join(__dir__, "data", "#{socket_name}_socket_properties")), + :stderr => "", :exit => 0 ) end - def stub_sockets + def stub_sockets socket: 'iscsid' stub_unit_command stub_systemctl(:socket) - stub_socket_properties - end - - def stub_socket_properties + properties = load_socket_properties(socket) Yast::SystemdUnit::Properties .any_instance .stub(:load_systemd_properties) - .and_return(socket_properties) + .and_return(properties) end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.22/package/yast2.changes new/yast2-3.1.23/package/yast2.changes --- old/yast2-3.1.22/package/yast2.changes 2014-03-06 09:38:04.000000000 +0100 +++ new/yast2-3.1.23/package/yast2.changes 2014-03-07 10:37:31.000000000 +0100 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Mar 6 15:21:44 UTC 2014 - vmora...@suse.com + +- Allow raising exceptions for not found systemd units; + updates the expectations for bnc#853300 +- 3.1.23 + +------------------------------------------------------------------- Thu Mar 6 07:48:29 UTC 2014 - vmora...@suse.com - Add systemd service support; needed by fate#314946 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.22/package/yast2.spec new/yast2-3.1.23/package/yast2.spec --- old/yast2-3.1.22/package/yast2.spec 2014-03-06 09:38:04.000000000 +0100 +++ new/yast2-3.1.23/package/yast2.spec 2014-03-07 10:37:31.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2 -Version: 3.1.22 +Version: 3.1.23 Release: 0 URL: https://github.com/yast/yast-yast2 -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org