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 4 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
57 changes: 14 additions & 43 deletions src/include/dhcp-server/dialogs2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1610,16 +1610,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 +1660,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 +1718,9 @@ 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", ""),
_("Ethernet")
Copy link
Member

Choose a reason for hiding this comment

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

maybe we can remove this column in table?

Copy link
Member Author

Choose a reason for hiding this comment

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

Another place where I was not sure. I'll remove it.

)
end

Expand Down Expand Up @@ -1783,18 +1766,7 @@ 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
Expand All @@ -1805,19 +1777,18 @@ def CheckMacAddrFormat
addr_type = Convert.to_string(
UI.QueryWidget(Id("network_type"), :CurrentButton)
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 widget still exists?

Copy link
Member Author

Choose a reason for hiding this comment

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

hm, it escaped ... will fix

)
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