Fedora Remix maintained by the Rochester Institute of Technology (RIT) Linux Users Group, targeted at users new to Linux and RIT students, faculty, and staff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
2.0 KiB

7 years ago
  1. #
  2. # tigeros.py
  3. #
  4. # Copyright (C) 2007 Red Hat, Inc. All rights reserved.
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. #
  19. from pyanaconda.installclass import BaseInstallClass
  20. from pyanaconda.product import productName
  21. from pyanaconda import network
  22. from pyanaconda import nm
  23. __all__ = ["TigerOSBaseInstallClass"]
  24. class TigerOSBaseInstallClass(BaseInstallClass):
  25. name = "TigerOS"
  26. sortPriority = 10000
  27. if not productName.startswith("TigerOS"): # pylint: disable=no-member
  28. hidden = True
  29. _l10n_domain = "anaconda"
  30. efi_dir = "tigeros"
  31. help_placeholder = "TigerOSPlaceholder.html"
  32. help_placeholder_plain_text = "TigerOSPlaceholder.txt"
  33. help_placeholder_with_links = "TigerOSPlaceholderWithLinks.html"
  34. def configure(self, anaconda):
  35. BaseInstallClass.configure(self, anaconda)
  36. def setNetworkOnbootDefault(self, ksdata):
  37. if any(nd.onboot for nd in ksdata.network.network if nd.device):
  38. return
  39. # choose first wired device having link
  40. for dev in nm.nm_devices():
  41. if nm.nm_device_type_is_wifi(dev):
  42. continue
  43. try:
  44. link_up = nm.nm_device_carrier(dev)
  45. except (nm.UnknownDeviceError, nm.PropertyNotFoundError):
  46. continue
  47. if link_up:
  48. network.update_onboot_value(dev, True, ksdata=ksdata)
  49. break
  50. def __init__(self):
  51. BaseInstallClass.__init__(self)