• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yast / yast-network / 4859995753

pending completion
4859995753

Pull #1327

github

Unknown Committer
Unknown Commit Message
Pull Request #1327: [WIP] Firmware configured interface

83 of 83 new or added lines in 7 files covered. (100.0%)

9246 of 11499 relevant lines covered (80.41%)

19.99 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.86
/src/lib/y2network/widgets/edit_interface.rb
1
# Copyright (c) [2019] SUSE LLC
2
#
3
# All Rights Reserved.
4
#
5
# This program is free software; you can redistribute it and/or modify it
6
# under the terms of version 2 of the GNU General Public License as published
7
# by the Free Software Foundation.
8
#
9
# This program is distributed in the hope that it will be useful, but WITHOUT
10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12
# more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with this program; if not, contact SUSE LLC.
16
#
17
# To contact SUSE LLC about this file by physical or electronic mail, you may
18
# find current contact information at www.suse.com.
19

20
require "y2network/widgets/interface_button"
1✔
21

22
module Y2Network
1✔
23
  module Widgets
1✔
24
    class EditInterface < InterfaceButton
1✔
25
      # Constructor
26
      #
27
      # @param table [InterfacesTable]
28
      def initialize(table)
1✔
29
        textdomain "network"
9✔
30
        super(table)
9✔
31
      end
32

33
      def label
1✔
34
        Yast::Label.EditButton
1✔
35
      end
36

37
      def handle
1✔
38
        builder = Y2Network::InterfaceConfigBuilder.for(item.type, config: connection_config)
3✔
39
        builder.name = item.name
3✔
40

41
        if item.is_a?(Y2Network::S390GroupDevice)
3✔
42
          builder.device_id = builder.name
×
43
          activation_dialog = Y2Network::Dialogs::S390DeviceActivation.for(builder)
×
44
          return :redraw if activation_dialog.run != :next
×
45
        end
46

47
        Y2Network::Sequences::Interface.new.public_send(:edit, builder)
3✔
48
        :redraw
3✔
49
      end
50

51
      def disable?
1✔
52
        return true unless @table.value
2✔
53

54
        configured_by_firmware?
1✔
55
      end
56

57
      def configured_by_firmware?
1✔
58
        return false if connection_config
1✔
59
        return false unless config.backend?(:wicked)
×
60

61
        require "network/wicked"
×
62
        singleton_class.include Yast::Wicked
×
63
        firmware_interfaces.include?(@table.value)
×
64
      end
65

66
      def help
1✔
67
        # TRANSLATORS: Help for 'Edit' interface configuration button
68
        _(
1✔
69
          "<p><b><big>Configuring:</big></b><br>\n" \
70
          "Choose a network card to change.\n" \
71
         "Then press <b>Edit</b>.</p>\n"
72
        )
73
      end
74
    end
75
  end
76
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc