SHARE
TWEET

is_cloud diff

celeste_ath Jun 18th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/virt-install b/virt-install
  2. index ee2b9006..1be0b91c 100755
  3. --- a/virt-install
  4. +++ b/virt-install
  5. @@ -399,6 +399,7 @@ def build_installer(options, guest, installdata):
  6.      install_kernel_args = installdata.kernel_args
  7.      install_os = installdata.os
  8.      no_install = installdata.no_install
  9. +    is_cloud = installdata.is_cloud
  10.      if installdata.kernel_args:
  11.          if installdata.kernel_args_overwrite:
  12.              install_kernel_args = installdata.kernel_args
  13. @@ -433,7 +434,8 @@ def build_installer(options, guest, installdata):
  14.              install_kernel=install_kernel,
  15.              install_initrd=install_initrd,
  16.              install_kernel_args=install_kernel_args,
  17. -            no_install=no_install)
  18. +            no_install=no_install,
  19. +            is_cloud=is_cloud)
  20.  
  21.      if options.unattended:
  22.          unattended_data = cli.parse_unattended(options.unattended)
  23. diff --git a/virtinst/cli.py b/virtinst/cli.py
  24. index 9a1fe2f6..a2a501a5 100644
  25. --- a/virtinst/cli.py
  26. +++ b/virtinst/cli.py
  27. @@ -1580,6 +1580,7 @@ class ParserInstall(VirtCLIParser):
  28.                  is_onoff=True)
  29.          cls.add_arg("os", "os")
  30.          cls.add_arg("no_install", "no_install", is_onoff=True)
  31. +        cls.add_arg("is_cloud", "is_cloud", is_onoff=True)
  32.  
  33.  
  34.  class InstallData:
  35. @@ -1592,6 +1593,7 @@ class InstallData:
  36.          self.os = None
  37.          self.is_set = False
  38.          self.no_install = None
  39. +        self.is_cloud = None
  40.  
  41.  
  42.  def parse_install(optstr):
  43. diff --git a/virtinst/install/installer.py b/virtinst/install/installer.py
  44. index f20ef376..348c248d 100644
  45. --- a/virtinst/install/installer.py
  46. +++ b/virtinst/install/installer.py
  47. @@ -50,7 +50,7 @@ class Installer(object):
  48.      def __init__(self, conn, cdrom=None, location=None, install_bootdev=None,
  49.              location_kernel=None, location_initrd=None,
  50.              install_kernel=None, install_initrd=None, install_kernel_args=None,
  51. -            no_install=None):
  52. +            no_install=None, is_cloud=None):
  53.          self.conn = conn
  54.  
  55.          # Entry point for virt-manager 'Customize' wizard to change autostart
  56. @@ -64,6 +64,7 @@ class Installer(object):
  57.  
  58.          self._install_bootdev = install_bootdev
  59.          self._no_install = no_install
  60. +        self._is_cloud = None
  61.  
  62.          self._treemedia = None
  63.          self._treemedia_bootconfig = None
  64. @@ -267,7 +268,8 @@ class Installer(object):
  65.          elif unattended_script:
  66.              self._prepare_unattended_data(guest, unattended_script)
  67.  
  68. -        elif guest.devices.disk[0].path.endswith("cloud.qcow2"):
  69. +        elif self.cdrom and self._is_cloud:
  70. +        #elif guest.devices.disk[0].path.endswith("cloud.qcow2"):
  71.              metadata = "meta-data"
  72.              userdata = "user-data"
  73.              create_metadata(metadata)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top