Skip to content

Commit

Permalink
Merge 2956ac0 into 2d75ee5
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jan 23, 2020
2 parents 2d75ee5 + 2956ac0 commit 02b7b3a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
6 changes: 6 additions & 0 deletions package/yast2-ftp-server.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jan 23 09:02:55 UTC 2020 - Josef Reidinger <jreidinger@suse.com>

- Fix return code of CLI "show" command (bsc#1143193)
- 4.2.4

-------------------------------------------------------------------
Mon Dec 30 16:11:40 UTC 2019 - Josef Reidinger <jreidinger@suse.com>

Expand Down
10 changes: 5 additions & 5 deletions package/yast2-ftp-server.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-ftp-server
Version: 4.2.3
Version: 4.2.4
Release: 0
Summary: YaST2 - FTP configuration
License: GPL-2.0-only
Expand All @@ -27,14 +27,14 @@ Url: https://github.com/yast/yast-ftp-server
Source0: %{name}-%{version}.tar.bz2

BuildRequires: update-desktop-files
# Yast2::Systemd::Service
BuildRequires: yast2 >= 4.1.3
# Yast2::CommandLine readonly parameter
BuildRequires: yast2 >= 4.2.57
BuildRequires: yast2-devtools >= 4.2.2
BuildRequires: rubygem(%rb_default_ruby_abi:rspec)
BuildRequires: rubygem(%rb_default_ruby_abi:yast-rake)

# Yast2::Systemd::Service
Requires: yast2 >= 4.1.3
# Yast2::CommandLine readonly parameter
Requires: yast2 >= 4.2.57
Requires: yast2-ruby-bindings >= 1.0.0

BuildArch: noarch
Expand Down
9 changes: 5 additions & 4 deletions src/lib/y2ftp/clients/ftp_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ def run
"finish" => fun_ref(Yast::FtpServer.method(:Write), "boolean ()"),
"actions" => {
"show" => {
"handler" => fun_ref(method(:FTPdCMDShow), "boolean (map)"),
"handler" => fun_ref(method(:FTPdCMDShow), "boolean (map)"),
# TRANSLATORS: CommandLine help
"help" => _("Display settings"),
"example" => ["show"]
"help" => _("Display settings"),
"example" => ["show"],
"readonly" => true
},
"startup" => {
"handler" => fun_ref(method(:FTPdCMDStartup), "boolean (map)"),
Expand Down Expand Up @@ -543,7 +544,7 @@ def FTPdCMDShow(_options)
end

CommandLine.Print("")
false
true
end

def FTPdCMDStartup(options)
Expand Down
4 changes: 4 additions & 0 deletions test/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
SRC_PATH = File.expand_path("../src", __dir__)
ENV["Y2DIR"] = SRC_PATH

# localization agnostic tests
ENV["LC_ALL"] = "en_US.utf-8"
ENV["LANG"] = "en_US.utf-8"

require "yast"

# stub module to prevent its Import
Expand Down
6 changes: 6 additions & 0 deletions test/y2ftp/clients/ftp_server_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
subject { described_class.new }

describe "#FTPdCMDShow" do
let(:anon_authen) { "0" }

before do
allow(Yast::FtpServer).to receive(:EDIT_SETTINGS).and_return("AnonAuthen" => anon_authen)

Expand Down Expand Up @@ -71,5 +73,9 @@
subject.FTPdCMDShow({})
end
end

it "returns true" do
expect(subject.FTPdCMDShow({})).to eq true
end
end
end

0 comments on commit 02b7b3a

Please sign in to comment.