Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No token ring anymore #52

Merged
merged 5 commits into from
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ before_install:
script:
# the "yast-travis-ruby" script is included in the base yastdevel/ruby image
# see https://github.com/yast/docker-yast-ruby/blob/master/yast-travis-ruby
- docker run -it -e TRAVIS=1 -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" yast-dhcp-server-image yast-travis-ruby
- docker run -it -e TRAVIS=1 -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" --privileged yast-dhcp-server-image yast-travis-ruby
7 changes: 7 additions & 0 deletions package/yast2-dhcp-server.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Sat Apr 4 17:06:50 UTC 2020 - Michal Filka <mfilka@suse.com>

- bsc#1167474
- removed token ring support
- 4.2.3

-------------------------------------------------------------------
Mon Feb 17 17:18:49 UTC 2020 - Stefan Hundhammer <shundhammer@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-dhcp-server.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-dhcp-server
Version: 4.2.2
Version: 4.2.3
Release: 0
Summary: YaST2 - DHCP Server Configuration
Group: System/YaST
Expand Down
2 changes: 1 addition & 1 deletion src/include/dhcp-server/commandline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def initialize_dhcp_server_commandline(include_target)
"The hardware type of the host with a fixed address"
),
"type" => "enum",
"typespec" => ["ethernet", "token-ring"]
"typespec" => ["ethernet"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this make sense at all? maybe for backward compatibility?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not sure. I've kept it for compatibility reasons only. AFAIK it is not mandatory anyway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so at least please add comment that it is just for backward compatibility and maybe after string freeze we can add to help text that it is now noop.

},
"ip-address" => {
# command line help text for an option
Expand Down
63 changes: 14 additions & 49 deletions src/include/dhcp-server/dialogs2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1578,9 +1578,7 @@ def Common_HostManagementDialog
# Table header item - IP of the host
_("IP"),
# MAC address of the host
_("Hardware Address"),
# Network type of the host
_("Type")
_("Hardware Address")
)
)
),
Expand Down Expand Up @@ -1610,16 +1608,6 @@ def Common_HostManagementDialog
Left(
TextEntry(Id("hosthwaddress"), _("&Hardware Address"))
),
# Radiobutton label - network type of the host
RadioButtonGroup(
Id("network_type"),
HBox(
Left(
RadioButton(Id("ethernet"), _("&Ethernet"), true)
),
Left(RadioButton(Id("token-ring"), _("&Token Ring")))
)
)
)
)
)
Expand Down Expand Up @@ -1670,11 +1658,6 @@ def SelectItem(id)
:Value,
Ops.get(opts, "hardware", "")
)
UI.ChangeWidget(
Id("network_type"),
:CurrentButton,
Ops.get(opts, "type", "ethernet")
)

nil
end
Expand Down Expand Up @@ -1733,11 +1716,8 @@ def HostManagementInit(key)
Item(
Id(id2),
id2,
Ops.get(opts, "ip", ""),
Ops.get(opts, "hardware", ""),
Ops.get(opts, "type", "ethernet") == "ethernet" ?
_("Ethernet") :
_("Token Ring")
opts.fetch("ip", ""),
opts.fetch("hardware", "")
)
end

Expand Down Expand Up @@ -1783,41 +1763,26 @@ def PrepareDirectives
end

value = Convert.to_string(UI.QueryWidget(Id("hosthwaddress"), :Value))
if Ops.greater_than(Builtins.size(value), 0)
# FIXME: validation
type = Convert.to_string(
UI.QueryWidget(Id("network_type"), :CurrentButton)
)
directives = Builtins.add(
directives,
{ "key" => "hardware", "value" => Ops.add(Ops.add(type, " "), value) }
)
end

deep_copy(directives)
directives << { "key" => "hardware", "value" => "ethernet #{value}" }
end

def CheckMacAddrFormat
hosthwaddress = Convert.to_string(
UI.QueryWidget(Id("hosthwaddress"), :Value)
)

addr_type = Convert.to_string(
UI.QueryWidget(Id("network_type"), :CurrentButton)
)
if addr_type == "ethernet" || addr_type == "token-ring"
if !Address.CheckMAC(hosthwaddress)
UI.SetFocus(Id("hosthwaddress"))
Report.Error(
Ops.add(
# error popup
_("The hardware address is invalid.\n"),
Address.ValidMAC
)
if !Address.CheckMAC(hosthwaddress)
UI.SetFocus(Id("hosthwaddress"))
Report.Error(
Ops.add(
# error popup
_("The hardware address is invalid.\n"),
Address.ValidMAC
)
return false
end
)
return false
end

true
end

Expand Down
18 changes: 1 addition & 17 deletions src/include/dhcp-server/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,6 @@ def hardwareInit(opt_id, opt_key)
value = Convert.to_string(fetchValue(opt_id, opt_key))
l = Builtins.splitstring(value, " ")
l = Builtins.filter(l) { |i| i != "" }
UI.ChangeWidget(Id(:hw), :Value, Ops.get(l, 0, "ethernet"))
UI.ChangeWidget(Id(:addr), :Value, Ops.get(l, 1, ""))

nil
Expand All @@ -907,11 +906,7 @@ def hardwareStore(opt_id, opt_key)
storeValue(
opt_id,
opt_key,
Builtins.sformat(
"%1 %2",
Convert.to_string(UI.QueryWidget(Id(:hw), :Value)),
Convert.to_string(UI.QueryWidget(Id(:addr), :Value))
)
"ethernet #{UI.QueryWidget(Id(:addr), :Value)}"
)

nil
Expand Down Expand Up @@ -1029,17 +1024,6 @@ def InitPopups
"popup" => {
"widget" => :custom,
"custom_widget" => VBox(
# combo box
ComboBox(
Id(:hw),
_("&Hardware Type"),
[
# combo box entry, networking technology name
Item(Id("ethernet"), _("Ethernet")),
# combo box entry, networking technology name
Item(Id("token-ring"), _("Token Ring"))
]
),
# test entry, MAC better not to be translated,
# translation would decrease the understandability
TextEntry(Id(:addr), _("&MAC Address"))
Expand Down