Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/virt-install b/virt-install
- index e0659a40..44a5c879 100755
- --- a/virt-install
- +++ b/virt-install
- @@ -368,6 +368,9 @@ def check_option_collisions(options, guest, installer):
- if options.initrd_inject or options.extra_args:
- fail(_("--unattended does not support --initrd-inject nor --extra-args."))
- + if options.install:
- + pass
- +
- def _show_nographics_warnings(options, guest, installer):
- if guest.devices.graphics:
- @@ -816,6 +819,8 @@ def parse_args():
- help=_("Add given file to root of initrd from --location"))
- insg.add_argument("--unattended",
- help=_("Perform a unattended installation"))
- + insg.add_argument("--install",
- + help=_("Perform cloud image installation with cloud-init configuration"))
- # Takes a URL and just prints to stdout the detected distro name
- insg.add_argument("--test-media-detection", help=argparse.SUPPRESS)
- diff --git a/virtinst/cli.py b/virtinst/cli.py
- index 7ba6b211..05841565 100644
- --- a/virtinst/cli.py
- +++ b/virtinst/cli.py
- @@ -28,6 +28,7 @@ from .devices import (Device, DeviceController, DeviceDisk, DeviceGraphics,
- from .nodedev import NodeDevice
- from .storage import StoragePool, StorageVolume
- from .unattended import UnattendedData
- +from .cloud import CloudInit
- ##########################
- @@ -463,7 +464,7 @@ def get_meter():
- def _get_completer_parsers():
- return VIRT_PARSERS + [ParserCheck, ParserLocation, ParserOSVariant,
- - ParserUnattended]
- + ParserUnattended, ParserCloudInit]
- def _virtparser_completer(prefix, **kwargs):
- @@ -1512,6 +1513,25 @@ def parse_unattended(optstr):
- return ret
- +########################
- +# --cloud-init parsing #
- +########################
- +
- +class ParserCloudInit(VirtCLIParser):
- + cli_arg_name = "install"
- +
- + @classmethod
- + def _init_class(cls, **kwargs):
- + VirtCLIParser._init_class(**kwargs)
- + cls.add_arg("is.cloud", "is_cloud")
- +
- +def parse_install(optstr):
- + ret = CloudInit()
- + parser = ParserCloudInit(optstr)
- + parser.parse(ret)
- + return ret
- +
- +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement