#1245 config: Deprecate bootable option
Merged 5 years ago by lsedlar. Opened 5 years ago by hlin.
hlin/pungi master  into  master

file modified
+1 -5
@@ -41,7 +41,6 @@ 

      check_deps = False

  

      # BUILDINSTALL

-     bootable = True

      buildinstall_method = "lorax"

  

  
@@ -521,8 +520,6 @@ 

  Options

  -------

  

- **bootable**

-     (*bool*) -- whether to run the buildinstall phase

  **buildinstall_method**

      (*str*) -- "lorax" (f16+, rhel7+) or "buildinstall" (older releases)

  **lorax_options**
@@ -565,7 +562,6 @@ 

  -------

  ::

  

-     bootable = True

      buildinstall_method = "lorax"

  

      # Enables macboot on x86_64 for all variants and builds upgrade images
@@ -1045,7 +1041,7 @@ 

  -------

  

  **productimg** = False

-     (*bool*) -- create product images; requires bootable=True

+     (*bool*) -- create product images; requires buildinstall_method option

  

  **productimg_install_class**

      (:ref:`scm_dict <scm_support>`, *str*) -- reference to install class **file**

file modified
+2 -11
@@ -52,7 +52,7 @@ 

  

  

  def _will_productimg_run(conf):

-     return conf.get('productimg', False) and conf.get('bootable', False)

+     return conf.get('productimg', False) and conf.get('buildinstall_method', '')

  

  

  def is_jigdo_needed(conf):
@@ -600,8 +600,7 @@ 

                  "default": False,

              },

              "bootable": {

-                 "type": "boolean",

-                 "default": False

+                 "deprecated": "remove it. Setting buildinstall_method option if you want a bootable installer"

              },

  

              "gather_method": {
@@ -1347,14 +1346,6 @@ 

          ),

      },

  

-     "bootable": {

-         "requires": (

-             (lambda x: x, ["buildinstall_method"]),

-         ),

-         "conflicts": (

-             (lambda x: not x, ["buildinstall_method"]),

-         ),

-     },

      "buildinstall_method": {

          "conflicts": (

              (lambda val: val == "buildinstall", ["lorax_options"]),

file modified
+1 -1
@@ -53,7 +53,7 @@ 

      def skip(self):

          if PhaseBase.skip(self):

              return True

-         if not self.compose.conf.get("bootable"):

+         if not self.compose.conf.get("buildinstall_method"):

              if not self.warned_skipped:

                  msg = "Not a bootable product. Skipping buildinstall."

                  self.compose.log_debug(msg)

file modified
+1 -1
@@ -63,7 +63,7 @@ 

          if skip == [True]:

              # Buildinstall is skipped for this tree. Can't create a bootable ISO.

              return False

-         return self.compose.conf["bootable"]

+         return bool(self.compose.conf.get('buildinstall_method', ''))

  

      def run(self):

          symlink_isos_to = self.compose.conf.get("symlink_isos_to")

file modified
+1 -1
@@ -86,7 +86,7 @@ 

  

          get_extra_files(compose, variant, arch, config.get('extra_files', []))

  

-         bootable = arch != "src" and compose.conf['bootable']

+         bootable = arch != "src" and bool(compose.conf.get('buildinstall_method'))

  

          graft_points = get_iso_contents(

              compose,

@@ -529,7 +529,7 @@ 

          comps = CompsWrapper(compose.paths.work.comps())

          for group in groups:

              packages_to_gather += comps.get_packages(group)

-     if compose.conf["gather_method"] == "nodeps" and not compose.conf.get('bootable'):

+     if compose.conf["gather_method"] == "nodeps" and not compose.conf.get('buildinstall_method'):

          populate_only_packages_to_gather = True

      else:

          populate_only_packages_to_gather = False

file modified
+1 -1
@@ -66,7 +66,7 @@ 

              msg = "Config option 'productimg' not set. Skipping creating product images."

              self.compose.log_debug(msg)

              return True

-         if not self.compose.conf["bootable"]:

+         if not self.compose.conf["buildinstall_method"]:

              msg = "Not a bootable product. Skipping creating product images."

              self.compose.log_debug(msg)

              return True

@@ -95,10 +95,6 @@ 

  }

  

  

- # BUILDINSTALL

- bootable = False

- 

- 

  # CREATEISO

  createiso_skip = [

      ('^Server-ResilientStorage$', {

file modified
+1 -1
@@ -74,7 +74,7 @@ 

          self.assertEqual(1, len(pool.queue_put.mock_calls))

  

      def test_does_not_skip_on_bootable(self):

-         compose = BuildInstallCompose(self.topdir, {'bootable': True})

+         compose = BuildInstallCompose(self.topdir, {'buildinstall_method': 'lorax'})

          compose.just_phases = None

          compose.skip_phases = []

  

file modified
+2 -2
@@ -90,7 +90,7 @@ 

  

      def test_isohybrid_not_required_on_arm(self):

          conf = {

-             'bootable': True,

+             'buildinstall_method': 'lorax',

              'productimg': True,

              'runroot_tag': 'dummy_tag',

          }
@@ -135,7 +135,7 @@ 

          conf = {

              'runroot_tag': 'dummy_tag',

              'productimg': True,

-             'bootable': True,

+             'buildinstall_method': 'lorax',

          }

  

          with mock.patch('sys.stdout', new_callable=StringIO) as out:

file modified
+3 -16
@@ -167,7 +167,7 @@ 

  

  

  class BuildinstallConfigTestCase(ConfigTestCase):

-     def test_bootable_without_method(self):

+     def test_bootable_deprecated(self):

          cfg = load_config(

              PKGSET_REPOS,

              bootable=True,
@@ -175,18 +175,7 @@ 

  

          self.assertValidation(

              cfg,

-             [checks.REQUIRES.format('bootable', 'True', 'buildinstall_method')])

- 

-     def test_non_bootable_with_method(self):

-         cfg = load_config(

-             PKGSET_REPOS,

-             bootable=False,

-             buildinstall_method='lorax',

-         )

- 

-         self.assertValidation(

-             cfg,

-             [checks.CONFLICTS.format('bootable', 'False', 'buildinstall_method')])

+             warnings=['WARNING: Config option bootable was removed and has no effect; remove it. Setting buildinstall_method option if you want a bootable installer.'])

  

      def test_buildinstall_method_without_bootable(self):

          cfg = load_config(
@@ -196,12 +185,11 @@ 

  

          self.assertValidation(

              cfg,

-             [checks.CONFLICTS.format('bootable', 'False', 'buildinstall_method')])

+             [])

  

      def test_buildinstall_with_lorax_options(self):

          cfg = load_config(

              PKGSET_REPOS,

-             bootable=True,

              buildinstall_method='buildinstall',

              lorax_options=[('^Server$', {})]

          )
@@ -213,7 +201,6 @@ 

      def test_lorax_with_lorax_options(self):

          cfg = load_config(

              PKGSET_REPOS,

-             bootable=True,

              buildinstall_method='lorax',

              lorax_options=[]

          )