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

yast / yast-network / 4859584370

pending completion
4859584370

Pull #1327

github

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

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

9240 of 11493 relevant lines covered (80.4%)

20.0 hits per line

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

73.08
/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
      def label
1✔
26
        Yast::Label.EditButton
1✔
27
      end
28

29
      def handle
1✔
30
        builder = Y2Network::InterfaceConfigBuilder.for(item.type, config: connection_config)
3✔
31
        builder.name = item.name
3✔
32

33
        if item.is_a?(Y2Network::S390GroupDevice)
3✔
34
          builder.device_id = builder.name
×
35
          activation_dialog = Y2Network::Dialogs::S390DeviceActivation.for(builder)
×
36
          return :redraw if activation_dialog.run != :next
×
37
        end
38

39
        Y2Network::Sequences::Interface.new.public_send(:edit, builder)
3✔
40
        :redraw
3✔
41
      end
42

43
      def disable?
1✔
44
        return true unless @table.value
2✔
45

46
        configured_by_firmware?
1✔
47
      end
48

49
      def configured_by_firmware?
1✔
50
        return false if connection_config
1✔
51
        return false unless config.backend?(:wicked)
×
52

53
        require "network/wicked"
×
54
        singleton_class.include Yast::Wicked
×
55
        firmware_interfaces.include?(@table.value)
×
56
      end
57

58
      def help
1✔
59
        # TRANSLATORS: Help for 'Edit' interface configuration button
60
        _(
1✔
61
          "<p><b><big>Configuring:</big></b><br>\n" \
62
          "Choose a network card to change.\n" \
63
         "Then press <b>Edit</b>.</p>\n"
64
        )
65
      end
66
    end
67
  end
68
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

© 2025 Coveralls, Inc